With the rest of the routes, most of the time you expect to call a helper method to generate the route.
eg:
link_to 'Recipes', recipes_path
There is an optimization where you can simply pass the recipe object and it will call an auxiliary method for you behind the scenes: for example:
link_to 'Recipe X', @recipe
coincides with
link_to 'Recipe X', recipe_path(@recipe)
However, this is just a special case.
, , , . , , , .to_s , , recipe_path, URL-.
. _path, _url.
_url URL-, http://stackoverflow.com/recipes/5, _path /recipes/5.
URL- , , rails mongrel, , , 1.2.3.4 (, IP- ) URL-, .
source
share