Good night everyone,
My name is Alfredo B. and I’m getting started with RoR. I have been
learning with “Agile Web D.”.
Now I’m trying to do my own web application. I have a problem and I
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
browser gives me this error
undefined local variable or method `user’ for
The question is, how can I call a method from a html.erb?.
Thank you so much, best regards.