Skip to content
This repository
Browse code

escaping otherwise autolinked "resource(s)" in resource.rb and assort…

…ed minor touches
  • Loading branch information...
commit 6bf05cbb439f247ae10ef9deb0f166f6794c088c 1 parent 5c9d1db
Xavier Noria fxn authored

Showing 1 changed file with 30 additions and 30 deletions. Show diff stats Hide diff stats

  1. +30 30 actionpack/lib/action_controller/resources.rb
60 actionpack/lib/action_controller/resources.rb
... ... @@ -1,23 +1,23 @@
1 1 module ActionController
2 2 # == Overview
3 3 #
4   - # ActionController::Resources are a way of defining RESTful resources. A RESTful resource, in basic terms,
  4 + # ActionController::Resources are a way of defining RESTful \resources. A RESTful \resource, in basic terms,
5 5 # is something that can be pointed at and it will respond with a representation of the data requested.
6 6 # In real terms this could mean a user with a browser requests an HTML page, or that a desktop application
7 7 # requests XML data.
8 8 #
9 9 # RESTful design is based on the assumption that there are four generic verbs that a user of an
10   - # application can request from a resource (the noun).
  10 + # application can request from a \resource (the noun).
11 11 #
12   - # Resources can be requested using four basic HTTP verbs (GET, POST, PUT, DELETE), the method used
  12 + # \Resources can be requested using four basic HTTP verbs (GET, POST, PUT, DELETE), the method used
13 13 # denotes the type of action that should take place.
14 14 #
15 15 # === The Different Methods and their Usage
16 16 #
17   - # +GET+ Requests for a resource, no saving or editing of a resource should occur in a GET request
18   - # +POST+ Creation of resources
19   - # +PUT+ Editing of attributes on a resource
20   - # +DELETE+ Deletion of a resource
  17 + # * GET - Requests for a \resource, no saving or editing of a \resource should occur in a GET request.
  18 + # * POST - Creation of \resources.
  19 + # * PUT - Editing of attributes on a \resource.
  20 + # * DELETE - Deletion of a \resource.
21 21 #
22 22 # === Examples
23 23 #
@@ -146,7 +146,7 @@ def initialize(entity, options)
146 146 end
147 147
148 148 # Creates named routes for implementing verb-oriented controllers
149   - # for a collection resource.
  149 + # for a collection \resource.
150 150 #
151 151 # For example:
152 152 #
@@ -241,20 +241,20 @@ def initialize(entity, options)
241 241 # Takes a hash of <tt>#{action} => #{method}</tt>, where method is <tt>:get</tt>/<tt>:post</tt>/<tt>:put</tt>/<tt>:delete</tt>
242 242 # 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+.
243 243 # * <tt>:member</tt> - Same as <tt>:collection</tt>, but for actions that operate on a specific member.
244   - # * <tt>:new</tt> - Same as <tt>:collection</tt>, but for actions that operate on the new resource action.
  244 + # * <tt>:new</tt> - Same as <tt>:collection</tt>, but for actions that operate on the new \resource action.
245 245 # * <tt>:controller</tt> - Specify the controller name for the routes.
246 246 # * <tt>:singular</tt> - Specify the singular name used in the member routes.
247 247 # * <tt>:requirements</tt> - Set custom routing parameter requirements.
248   - # * <tt>:conditions</tt> - Specify custom routing recognition conditions. Resources sets the <tt>:method</tt> value for the method-specific routes.
249   - # * <tt>:as</tt> - Specify a different resource name to use in the URL path. For example:
  248 + # * <tt>:conditions</tt> - Specify custom routing recognition conditions. \Resources sets the <tt>:method</tt> value for the method-specific routes.
  249 + # * <tt>:as</tt> - Specify a different \resource name to use in the URL path. For example:
250 250 # # products_path == '/productos'
251 251 # map.resources :products, :as => 'productos' do |product|
252 252 # # product_reviews_path(product) == '/productos/1234/comentarios'
253 253 # product.resources :product_reviews, :as => 'comentarios'
254 254 # end
255 255 #
256   - # * <tt>:has_one</tt> - Specify nested resources, this is a shorthand for mapping singleton resources beneath the current.
257   - # * <tt>:has_many</tt> - Same has <tt>:has_one</tt>, but for plural resources.
  256 + # * <tt>:has_one</tt> - Specify nested \resources, this is a shorthand for mapping singleton \resources beneath the current.
  257 + # * <tt>:has_many</tt> - Same has <tt>:has_one</tt>, but for plural \resources.
258 258 #
259 259 # You may directly specify the routing association with +has_one+ and +has_many+ like:
260 260 #
@@ -277,18 +277,18 @@ def initialize(entity, options)
277 277 #
278 278 # * <tt>:path_prefix</tt> - Set a prefix to the routes with required route variables.
279 279 #
280   - # Weblog comments usually belong to a post, so you might use resources like:
  280 + # Weblog comments usually belong to a post, so you might use +resources+ like:
281 281 #
282 282 # map.resources :articles
283 283 # map.resources :comments, :path_prefix => '/articles/:article_id'
284 284 #
285   - # You can nest resources calls to set this automatically:
  285 + # You can nest +resources+ calls to set this automatically:
286 286 #
287 287 # map.resources :articles do |article|
288 288 # article.resources :comments
289 289 # end
290 290 #
291   - # The comment resources work the same, but must now include a value for <tt>:article_id</tt>.
  291 + # The comment \resources work the same, but must now include a value for <tt>:article_id</tt>.
292 292 #
293 293 # article_comments_url(@article)
294 294 # article_comment_url(@article, @comment)
@@ -306,18 +306,18 @@ def initialize(entity, options)
306 306 # map.resources :tags, :path_prefix => '/books/:book_id', :name_prefix => 'book_'
307 307 # map.resources :tags, :path_prefix => '/toys/:toy_id', :name_prefix => 'toy_'
308 308 #
309   - # You may also use <tt>:name_prefix</tt> to override the generic named routes in a nested resource:
  309 + # You may also use <tt>:name_prefix</tt> to override the generic named routes in a nested \resource:
310 310 #
311 311 # map.resources :articles do |article|
312 312 # article.resources :comments, :name_prefix => nil
313 313 # end
314 314 #
315   - # This will yield named resources like so:
  315 + # This will yield named \resources like so:
316 316 #
317 317 # comments_url(@article)
318 318 # comment_url(@article, @comment)
319 319 #
320   - # If <tt>map.resources</tt> is called with multiple resources, they all get the same options applied.
  320 + # If <tt>map.resources</tt> is called with multiple \resources, they all get the same options applied.
321 321 #
322 322 # Examples:
323 323 #
@@ -349,28 +349,28 @@ def initialize(entity, options)
349 349 #
350 350 # The +resources+ method sets HTTP method restrictions on the routes it generates. For example, making an
351 351 # HTTP POST on <tt>new_message_url</tt> will raise a RoutingError exception. The default route in
352   - # <tt>config/routes.rb</tt> overrides this and allows invalid HTTP methods for resource routes.
  352 + # <tt>config/routes.rb</tt> overrides this and allows invalid HTTP methods for \resource routes.
353 353 def resources(*entities, &block)
354 354 options = entities.extract_options!
355 355 entities.each { |entity| map_resource(entity, options.dup, &block) }
356 356 end
357 357
358   - # Creates named routes for implementing verb-oriented controllers for a singleton resource.
359   - # A singleton resource is global to its current context. For unnested singleton resources,
360   - # the resource is global to the current user visiting the application, such as a user's
361   - # /account profile. For nested singleton resources, the resource is global to its parent
362   - # resource, such as a <tt>projects</tt> resource that <tt>has_one :project_manager</tt>.
363   - # The <tt>project_manager</tt> should be mapped as a singleton resource under <tt>projects</tt>:
  358 + # Creates named routes for implementing verb-oriented controllers for a singleton \resource.
  359 + # A singleton \resource is global to its current context. For unnested singleton \resources,
  360 + # the \resource is global to the current user visiting the application, such as a user's
  361 + # <tt>/account</tt> profile. For nested singleton \resources, the \resource is global to its parent
  362 + # \resource, such as a <tt>projects</tt> \resource that <tt>has_one :project_manager</tt>.
  363 + # The <tt>project_manager</tt> should be mapped as a singleton \resource under <tt>projects</tt>:
364 364 #
365 365 # map.resources :projects do |project|
366 366 # project.resource :project_manager
367 367 # end
368 368 #
369   - # See map.resources for general conventions. These are the main differences:
370   - # * A singular name is given to map.resource. The default controller name is still taken from the plural name.
  369 + # See +resources+ for general conventions. These are the main differences:
  370 + # * A singular name is given to <tt>map.resource</tt>. The default controller name is still taken from the plural name.
371 371 # * To specify a custom plural name, use the <tt>:plural</tt> option. There is no <tt>:singular</tt> option.
372   - # * No default index route is created for the singleton resource controller.
373   - # * When nesting singleton resources, only the singular name is used as the path prefix (example: 'account/messages/1')
  372 + # * No default index route is created for the singleton \resource controller.
  373 + # * When nesting singleton \resources, only the singular name is used as the path prefix (example: 'account/messages/1')
374 374 #
375 375 # For example:
376 376 #

0 comments on commit 6bf05cb

Please sign in to comment.
Something went wrong with that request. Please try again.