Undifined method! driving me insane!

Hi all,

im new to ruby on rails, this is my first project and im stuck on a
rather (i expect) simple problem. :frowning:

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

my profile

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

On 22 September 2010 11:52, Al Rowan [email protected] wrote:

but i keep getting the error

“undefined method ‘show_profile_path’ for …”

<%= link_to “Profile”, @profile %>

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

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_url

oh ace that “rake routes” thing helped a treat! thanks alot :smiley:

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs