Skip to content

Commit

Permalink
Improve docs of ActionDispatch::Routing::Mapper
Browse files Browse the repository at this point in the history
  • Loading branch information
bogdanvlviv committed Nov 3, 2017
1 parent 9ec6736 commit 11f3f03
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions actionpack/lib/action_dispatch/routing/mapper.rb
Expand Up @@ -475,6 +475,16 @@ module Base
#
# resources :users, param: :name
#
# The +users+ resource here will have the following routes generated for it:
#
# GET /users(.:format)
# POST /users(.:format)
# GET /users/new(.:format)
# GET /users/:name/edit(.:format)
# GET /users/:name(.:format)
# PATCH/PUT /users/:name(.:format)
# DELETE /users/:name(.:format)
#
# You can override <tt>ActiveRecord::Base#to_param</tt> of a related
# model to construct a URL:
#
Expand All @@ -484,8 +494,8 @@ module Base
# end
# end
#
# user = User.find_by(name: 'Phusion')
# user_path(user) # => "/users/Phusion"
# user = User.find_by(name: 'Phusion')
# user_path(user) # => "/users/Phusion"
#
# [:path]
# The path prefix for the routes.
Expand Down Expand Up @@ -1265,7 +1275,7 @@ def resources_path_names(options)
# POST /profile
#
# === Options
# Takes same options as +resources+.
# Takes same options as resources[rdoc-ref:#resources]
def resource(*resources, &block)
options = resources.extract_options!.dup

Expand Down Expand Up @@ -1330,7 +1340,7 @@ def resource(*resources, &block)
# DELETE /photos/:photo_id/comments/:id
#
# === Options
# Takes same options as <tt>Base#match</tt> as well as:
# Takes same options as match[rdoc-ref:Base#match] as well as:
#
# [:path_names]
# Allows you to change the segment component of the +edit+ and +new+ actions.
Expand Down

0 comments on commit 11f3f03

Please sign in to comment.