On 21 April 2014 19:37, Alfredo Barrero <[email protected]> wrote:
> Hi everyone! I have this form, "users/add_photo.html.erb" This form is
> render with the instance variable @photo. I want to pass the id of the
> current user. This form is called throught this method in
> "users_controller.erb"
>
> def add_photo
>     @photo = Photo.new
>     @us_id = params[:id]
>     render 'add_photo'
>   end
>
> The thing is that I'm not available to send the current id of the user, the
> form is not recongnizing @us_id. Any idea?.

What do you mean by 'the form is not recognising @us_id'?  Is it
showing an error, if so what error?

Colin

>
> <%= form_for @photo, :url => photos_path, :html => { :multipart => true } do
> |f| %>
>
>     <div class="field">
>       <%= f.label :title %><br>
>       <%= f.text_field :title %>
>     </div>
>     <div>
>         <div>
>           <%= hidden_field(:id, :us_id)
>         </div>
>           <%= f.file_field :avatar %>
>     </div>
>     <div class="actions">
>       <%= f.submit %>
>     </div>
> <% end %
>
>
>
> Thank you very much. Regards.
>
> Alfredo
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rubyonrails-talk/92914078-53bd-4a95-b7bf-010619c97c67%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLufuF3%3DKnG4WTeF6bgj7xoO6Z4ZYFAZjHMfZM%2BUo-PDNA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to