Good night everyone, My name is Alfredo Barrero and I'm getting started with RoR. I have been learning with "Agile Web Development". Now I'm trying to do my own web application. I have a problem and I don't know what I'm doing wrong, could you please give me a hand?. This is what I'm trying to do: <%= button_to 'Add Photo' , home_add_path(user_id: user) %> I have this line on "routes.rb" => get '/home/add' => 'photos#add', but the browser gives me this error undefined local variable or method `user' for #<#<Class:0x007fe075485dc0>:0x007fe0738e8d38> The question is, how can I call a method from a html.erb?. Thank you so much, best 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 rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/01215907-96f6-46f5-9da6-9dcea927e848%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.