未验证 提交 11f3f037 编写于 作者: B bogdanvlviv

Improve docs of ActionDispatch::Routing::Mapper

上级 9ec67362
......@@ -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:
#
......@@ -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.
......@@ -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
......@@ -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.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册