diff options
author | bogdanvlviv <bogdanvlviv@gmail.com> | 2017-11-03 23:33:55 +0000 |
---|---|---|
committer | bogdanvlviv <bogdanvlviv@gmail.com> | 2017-11-03 23:33:55 +0000 |
commit | 11f3f0377ba392c15a7fa6130be16db6318a2575 (patch) | |
tree | 87af30f15f0d0e5e71454b8c38338a12392dae1f /actionpack/lib/action_dispatch | |
parent | 9ec67362054e874ed905310a79b670941fa397af (diff) | |
download | rails-11f3f0377ba392c15a7fa6130be16db6318a2575.tar.gz rails-11f3f0377ba392c15a7fa6130be16db6318a2575.tar.bz2 rails-11f3f0377ba392c15a7fa6130be16db6318a2575.zip |
Improve docs of ActionDispatch::Routing::Mapper
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index dea8387c3d..ded42adee9 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -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. |