oferar
September 29, 2008, 8:06pm
1
Hello, I’m playing with a depot sample application from (Agile …) and
notice the following on a view:
<%= link_to ‘Edit’, edit_product_path(@product ) %> |
<%= link_to ‘Back’, products_path %>
I added a new model/view/controller, and in the view displayed all the
methods, and notice that I have xxx_product_methods included.
Where they come from? How can I add people_path for example if I added a
people controller?
Thanks very much.
regards;
fernando.
oferar
September 29, 2008, 8:42pm
2
Fernando R. [email protected] writes:
Where they come from? How can I add people_path for example if I added a
people controller?
They come from the map.resources lines in config/routes.rb. See
http://api.rubyonrails.org/classes/ActionController/Resources.html#M000696
for more information.
to add such paths for a ‘people’ controller, add a line like
map.resources :people
to config/routes.rb
Cheers – Eric
oferar
August 3, 2012, 9:14am
3
On Monday, September 29, 2008 11:28:53 AM UTC-7, Eric S. wrote:
They come from the map.resources lines in config/routes.rb. See
http://api.rubyonrails.org/classes/ActionController/Resources.html#M000696
for more information.
This link is now invalid, I’m 90% sure the correct location is currently
in
http://api.rubyonrails.org/ under
ActionDispatch::Routing::Mapper::Resources
(sorry I can’t seem to get the direct link).
– Cedric
oferar
September 30, 2008, 6:48pm
4
Thanks very much Eric!
fernando.