1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #31048 from bogdanvlviv/improve-docs-for-action_dispatch-routing-mapper

Improve docs of ActionDispatch::Routing::Mapper [ci skip]
This commit is contained in:
Ryuta Kamizono 2017-11-04 16:00:25 +09:00 committed by GitHub
commit c398706594
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -475,6 +475,16 @@ module ActionDispatch
#
# 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:
#
@ -484,8 +494,8 @@ module ActionDispatch
# 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.
@ -1265,7 +1275,7 @@ module ActionDispatch
# 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
@ -1330,7 +1340,7 @@ module ActionDispatch
# 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.