Ruby on Rails Wednesday, June 6, 2012

Colin Law wrote in post #1063357:
> On 6 June 2012 15:33, Perry Smith <lists@ruby-forum.com> wrote:
>> Thanks.
>>
>> 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
> example.
>
> 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
> resourceful route.
>
> Colin

Sorry... I'm reading this from the forum interface and didn't consider
people reading it via email.

You are correct. I added

resources :pogos

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.

--
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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment