path methods. Where they came from?

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.

Fernando Ruscitti <rails-mailing-list@andreas-s.net> writes:

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?

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

Thanks very much Eric!
fernando.