I have a profile resources with edit_profile_path
now I am trying add the link of it on a sitewide menu hence adding the link on application.html.erb
<%= link_to 'My Profile', edit_profile_path %>
All this looks very straight forward but I am getting error
No route matches {:action=>"edit", :controller=>"profiles"}
I did some searching and found this Rails 3 - Nested Resources Routing - One to One relationship but here the problem was nested routing which I don't have, here is what my rake routes give
edit_profile GET /profiles/:id/edit(.:format) profiles#edit
I am using devise but not sure this has anything to do with it though I do have
@profile = current_user.build_profile(params[:profile])
in profiles.controller.rb
Any idea how to show the profile links on application.html.erb ? I am sure it is something very small which I am missing out
EDIT - I have added (@profile)
in link_to path, now I am getting this error -
No route matches {:action=>"edit", :controller=>"profiles", :id=>nil}
?
I am using devise and is using @profile = current_user.build_profile(params[:profile]) in profiles_controller.rb