Hi all, im new to ruby on rails, this is my first project and im stuck on a rather (i expect) simple problem. :( ive made a link <%= link_to "Profile", show_profile_path %> in my main application.html.erb i have a profiles_controller.rb with the method "show" in it "def show @profile = Profile.find(current_user.id) end" and i have "resources :profiles" in my routers.rb i also have a show.html.erb file with in <h1>my profile</h1> but i keep getting the error "undefined method ''show_profile_path'' for ..." it dosnt make any sence to me as ive got another link to new_profile_path that works?! please help, much thanks Al -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 22 September 2010 11:52, Al Rowan <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> but i keep getting the error > > "undefined method ''show_profile_path'' for ..."<%= link_to "Profile", @profile %> -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
next time type rake routes and look at the names of the helpers there you will see the helper for the show action is profile_path no show_profile_path, the output of rake route does not add the path ad the end because it could be something else like url, e.g. profile_url On Wed, Sep 22, 2010 at 6:57 AM, Michael Pavling <pavling-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 22 September 2010 11:52, Al Rowan <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: > > but i keep getting the error > > > > "undefined method ''show_profile_path'' for ..." > > <%= link_to "Profile", @profile %> > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
radhames brito wrote:> next time type rake routes and look at the names of the helpers there > you > will see the helper for the show action is > > profile_path no show_profile_path, the output of rake route does not add > the > path ad the end because it could be something else > > like url, e.g. profile_urloh ace that "rake routes" thing helped a treat! thanks alot :D -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.