I am trying this code in my application layout. its a “user navigation” bar at the top of the screen.
<%= link_to "My Profile", edit_profile_path, :class => "user_nav_button" %>
I am getting
No route matches {:action=>”edit”, :controller=>”profiles”}
However, rake routes shows:
edit_profile GET /profiles/:id/edit(.:format) profiles#edit
If i directly go to /profiles/1/edit my view works, and the link_to shows……….
I think it has something to do with not getting the params properly… I am using devise/cancan/rolify and current_user.id is my param.
That path method call requires an instance of the object. Otherwise Rails doesn’t know which user profile you want to edit and it doesn’t guess.