0
@@ -236,27 +236,27 @@ module ActionController
0
# which takes into account whether <tt>@message</tt> is a new record or not and generates the
0
# path and method accordingly.
0
- # The #resources method accepts the following options to customize the resulting routes:
0
- # * <tt>:collection</tt> - add named routes for other actions that operate on the collection.
0
+ # The +resources+ method accepts the following options to customize the resulting routes:
0
+ # * <tt>:collection</tt> - Add named routes for other actions that operate on the collection.
0
# Takes a hash of <tt>#{action} => #{method}</tt>, where method is <tt>:get</tt>/<tt>:post</tt>/<tt>:put</tt>/<tt>:delete</tt>
0
- # or <tt>:any</tt> if the method does not matter. These routes map to a URL like /messages/rss, with a route of rss_messages_url.
0
- # * <tt>:member</tt> - same as <tt>:collection</tt>, but for actions that operate on a specific member.
0
- # * <tt>:new</tt> - same as <tt>:collection</tt>, but for actions that operate on the new resource action.
0
- # * <tt>:controller</tt> - specify the controller name for the routes.
0
- # * <tt>:singular</tt> - specify the singular name used in the member routes.
0
- # * <tt>:requirements</tt> - set custom routing parameter requirements.
0
- # * <tt>:conditions</tt> - specify custom routing recognition conditions. Resources sets the <tt>:method</tt> value for the method-specific routes.
0
- # * <tt>:as</tt> - specify a different resource name to use in the URL path. For example:
0
+ # or <tt>:any</tt> if the method does not matter. These routes map to a URL like /messages/rss, with a route of +rss_messages_url+.
0
+ # * <tt>:member</tt> - Same as <tt>:collection</tt>, but for actions that operate on a specific member.
0
+ # * <tt>:new</tt> - Same as <tt>:collection</tt>, but for actions that operate on the new resource action.
0
+ # * <tt>:controller</tt> - Specify the controller name for the routes.
0
+ # * <tt>:singular</tt> - Specify the singular name used in the member routes.
0
+ # * <tt>:requirements</tt> - Set custom routing parameter requirements.
0
+ # * <tt>:conditions</tt> - Specify custom routing recognition conditions. Resources sets the <tt>:method</tt> value for the method-specific routes.
0
+ # * <tt>:as</tt> - Specify a different resource name to use in the URL path. For example:
0
# # products_path == '/productos'
0
# map.resources :products, :as => 'productos' do |product|
0
# # product_reviews_path(product) == '/productos/1234/comentarios'
0
# product.resources :product_reviews, :as => 'comentarios'
0
- # * <tt>:has_one</tt> - specify nested resources, this is a shorthand for mapping singleton resources beneath the current.
0
- # * <tt>:has_many</tt> - same has <tt>:has_one</tt>, but for plural resources.
0
+ # * <tt>:has_one</tt> - Specify nested resources, this is a shorthand for mapping singleton resources beneath the current.
0
+ # * <tt>:has_many</tt> - Same has <tt>:has_one</tt>, but for plural resources.
0
- # You may directly specify the routing association with
has_one and has_many like:
0
+ # You may directly specify the routing association with
+has_one+ and +has_many+ like:
0
# map.resources :notes, :has_one => :author, :has_many => [:comments, :attachments]
0
@@ -268,14 +268,14 @@ module ActionController
0
# notes.resources :attachments
0
- # * <tt>:path_names</tt> -
specify different names for the 'new' and 'edit' actions. For example:
0
+ # * <tt>:path_names</tt> -
Specify different names for the 'new' and 'edit' actions. For example:
0
# # new_products_path == '/productos/nuevo'
0
# map.resources :products, :as => 'productos', :path_names => { :new => 'nuevo', :edit => 'editar' }
0
# You can also set default action names from an environment, like this:
0
# config.action_controller.resources_path_names = { :new => 'nuevo', :edit => 'editar' }
0
- # * <tt>:path_prefix</tt> -
set a prefix to the routes with required route variables.
0
+ # * <tt>:path_prefix</tt> -
Set a prefix to the routes with required route variables.
0
# Weblog comments usually belong to a post, so you might use resources like:
0
@@ -296,7 +296,7 @@ module ActionController
0
# article_comments_url(:article_id => @article)
0
# article_comment_url(:article_id => @article, :id => @comment)
0
- # * <tt>:name_prefix</tt> -
define a prefix for all generated routes, usually ending in an underscore.
0
+ # * <tt>:name_prefix</tt> -
Define a prefix for all generated routes, usually ending in an underscore.
0
# Use this if you have named routes that may clash.
0
# map.resources :tags, :path_prefix => '/books/:book_id', :name_prefix => 'book_'
0
@@ -343,7 +343,7 @@ module ActionController
0
# # --> GET /categories/7/messages/1
0
# # has named route "category_message"
0
- # The
#resources method sets HTTP method restrictions on the routes it generates. For example, making an
0
+ # The
+resources+ method sets HTTP method restrictions on the routes it generates. For example, making an
0
# HTTP POST on <tt>new_message_url</tt> will raise a RoutingError exception. The default route in
0
# <tt>config/routes.rb</tt> overrides this and allows invalid HTTP methods for resource routes.
0
def resources(*entities, &block)