Colin Law wrote in post #1063357:
I checked http://guides.rubyonrails.org/routing.html first. The code I
have, to my eyes, match the lead examples in sections 1.1 and 1.2.
There must be something I'm overlooking.
Please quote the previous message when replying so that it is easier
to follow the thread. Anyone reading this will now have to look back
at previous messages to check your code (myself included).
1.1 of the guide does not include the use of _path, 1.2 has the code
<%= link_to "Patient Record", patient_path(@patient) %>
note that this uses @patient as the parameter, not an id as in your
Section 2.3 shows the use of photo_path(id) where resourceful routes
are used as I said in my previous post, but you have not specified a
Sorry... I'm reading this from the forum interface and didn't consider
people reading it via email.
You are correct. I added
to routes.rb and now I can do:
<%= link_to "pogo", pogo_path(1234) %>
in my view.
I thought resources were just a batch of named routes and I thought what
I did before was a named route. I need to go check on that.
What confuses me is that blah_path is not even defined. It seems like
if it needed a particular type of argument, then the error would be
inside blah_path -- not in the code trying to find the blah_path method.
I wonder if Rails is eating the top of the exception stack which might
help me understand what is really happening in this case.
Thank you for your time.