Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #10362: resource_docs_no_plural_option.trunk.diff

File resource_docs_no_plural_option.trunk.diff, 1.7 kB (added by kampers, 5 months ago)
  • actionpack/lib/action_controller/resources.rb

    old new  
    331331    #     project.resource :project_manager 
    332332    #   end 
    333333    # 
    334     # See map.resources for general conventions.  These are the main differences: 
    335     # * A singular name is given to map.resource.  The default controller name is still taken from the plural name. 
    336     # * To specify a custom plural name, use the :plural option.  There is no :singular option. 
    337     # * No default index route is created for the singleton resource controller. 
    338     # * When nesting singleton resources, only the singular name is used as the path prefix (example: 'account/messages/1') 
     334    # See <tt>#resources</tt> for general conventions.  These are the main differences: 
     335    # * A singular name is passed to <tt>resource</tt>. The controller's name is 
     336    #   inferred by pluralizing this name. To use a different controller, use the 
     337    #   <tt>:controller</tt> option. 
     338    # * No +index+ route is created. 
     339    # * When resources are nested, and a singleton resource forms part of a 
     340    #   path prefix, the singular name is used (example: <tt>/account/messages/1</tt>). 
    339341    # 
    340342    # For example: 
    341343    # 
     
    375377    #     end 
    376378    #   end 
    377379    # 
    378     # Along with the routes themselves, #resource generates named routes for 
     380    # Along with the routes themselves, <tt>#resource</tt> generates named routes for 
    379381    # use in controllers and views. <tt>map.resource :account</tt> produces 
    380382    # these named routes and helpers: 
    381383    #