Cameron Vessey wrote in post #955645:
>
> The index page has a link_to that looks like
>
> <td><%= link_to 'Edit', edit_tire_path(tire) %></td>
>
> now maybe I'm missing it but I've tried to find out were the scaffold
> put the route or mapping of this edit link_to so that it works.
>

Try executing a "rake routes >routes.lst" in your app folder, then take 
a look at the contents of routes.lst.

There you'll see the all routes (and path aliases) that Rails 
'magically' creates from the info in your routes.rb file.

edit_tire
new_tire
tire

in all the supported flavors of HTTP verbs.  Just append a _path, and 
there's your routing alias.

edit_tire_path(tire) is equivalent to

:controller => 'tires', :action => 'edit', :id => tire.id

unless I haven't had enough coffee this morning.

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

Reply via email to