Reputation: 6244
I am updating to apply dmarkow's suggestions.
in my routes.rb:
resources :userhome do
member do
get :edit_profile_picture
end
member do
post :update_profile_picture
end
end
rake routes result:
edit_profile_picture_userhome
update_profile_picture_userhome
the link in the user home page:
<%= link_to "update profile picture", edit_profile_picture_userhome_path(@user) %>
controller:
def edit_profile_picture
@user = current_user
end
error message:
No route matches {:action=>"edit_profile_picture", :controller=>"userhome"}
I missed the fact that i didn't change the name of my view to match my controller and route. I'm going to follow naming conventions more closely to help me avoid this kind of mistake.
Upvotes: 0
Views: 230
Reputation: 124469
You need to provide a Userhome
ID or object to your path. Assuming that the currently-displayed Userhome
is @userhome
:
<%= link_to "update profile picture", profile_picture_userhome_path(@userhome) %>
Upvotes: 1