Skip to content
This repository
Browse code

Merge branch 'master' of github.com:lifo/docrails

Conflicts:
	actionpack/lib/action_controller/metal/mime_responds.rb
	activerecord/lib/active_record/attribute_methods.rb
	guides/source/working_with_javascript_in_rails.md
  • Loading branch information...
commit 3b0bb08699ce409b8213c82956dc34086dcbc8b9 2 parents 974467d + ee91749
Vijay Dev vijaydev authored

Showing 105 changed files with 873 additions and 809 deletions. Show diff stats Hide diff stats

  1. +2 2 actionpack/lib/action_controller/metal.rb
  2. +1 1  actionpack/lib/action_controller/metal/conditional_get.rb
  3. +5 5 actionpack/lib/action_controller/metal/data_streaming.rb
  4. +1 1  actionpack/lib/action_controller/metal/force_ssl.rb
  5. +2 2 actionpack/lib/action_controller/metal/head.rb
  6. +10 10 actionpack/lib/action_controller/metal/http_authentication.rb
  7. +13 13 actionpack/lib/action_controller/metal/mime_responds.rb
  8. +2 2 actionpack/lib/action_controller/metal/params_wrapper.rb
  9. +11 11 actionpack/lib/action_controller/metal/redirecting.rb
  10. +3 3 actionpack/lib/action_controller/metal/renderers.rb
  11. +3 3 actionpack/lib/action_controller/metal/request_forgery_protection.rb
  12. +10 10 actionpack/lib/action_controller/metal/responder.rb
  13. +3 3 actionpack/lib/action_controller/metal/streaming.rb
  14. +1 1  actionpack/lib/action_controller/metal/strong_parameters.rb
  15. +1 1  actionpack/lib/action_controller/metal/url_for.rb
  16. +11 11 actionpack/lib/action_controller/test_case.rb
  17. +2 2 actionpack/lib/action_dispatch/http/mime_type.rb
  18. +7 7 actionpack/lib/action_dispatch/middleware/cookies.rb
  19. +2 2 actionpack/lib/action_dispatch/middleware/session/cookie_store.rb
  20. +2 2 actionpack/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb
  21. +1 1  actionpack/lib/action_dispatch/middleware/templates/rescues/routing_error.erb
  22. +2 2 actionpack/lib/action_dispatch/middleware/templates/rescues/template_error.erb
  23. +24 24 actionpack/lib/action_dispatch/routing.rb
  24. +55 55 actionpack/lib/action_dispatch/routing/mapper.rb
  25. +3 3 actionpack/lib/action_dispatch/routing/polymorphic_routes.rb
  26. +4 4 actionpack/lib/action_dispatch/routing/redirection.rb
  27. +6 6 actionpack/lib/action_dispatch/routing/route_set.rb
  28. +15 15 actionpack/lib/action_dispatch/routing/url_for.rb
  29. +3 3 actionpack/lib/action_dispatch/testing/assertions/response.rb
  30. +15 15 actionpack/lib/action_dispatch/testing/assertions/routing.rb
  31. +1 1  actionpack/lib/action_dispatch/testing/assertions/selector.rb
  32. +19 19 actionpack/lib/action_dispatch/testing/assertions/tag.rb
  33. +6 6 actionpack/lib/action_dispatch/testing/integration.rb
  34. +2 2 actionpack/lib/action_dispatch/testing/test_process.rb
  35. +1 1  actionpack/lib/action_view/base.rb
  36. +32 32 actionpack/lib/action_view/helpers/asset_tag_helper.rb
  37. +6 6 actionpack/lib/action_view/helpers/atom_feed_helper.rb
  38. +5 5 actionpack/lib/action_view/helpers/capture_helper.rb
  39. +94 94 actionpack/lib/action_view/helpers/date_helper.rb
  40. +1 1  actionpack/lib/action_view/helpers/debug_helper.rb
  41. +22 22 actionpack/lib/action_view/helpers/form_options_helper.rb
  42. +54 54 actionpack/lib/action_view/helpers/form_tag_helper.rb
  43. +4 4 actionpack/lib/action_view/helpers/javascript_helper.rb
  44. +56 56 actionpack/lib/action_view/helpers/number_helper.rb
  45. +3 3 actionpack/lib/action_view/helpers/record_tag_helper.rb
  46. +2 2 actionpack/lib/action_view/helpers/rendering_helper.rb
  47. +1 1  actionpack/lib/action_view/helpers/sanitize_helper.rb
  48. +7 7 actionpack/lib/action_view/helpers/tag_helper.rb
  49. +22 22 actionpack/lib/action_view/helpers/text_helper.rb
  50. +1 1  actionpack/lib/action_view/helpers/translation_helper.rb
  51. +4 4 actionpack/lib/action_view/helpers/url_helper.rb
  52. +27 27 actionpack/lib/action_view/renderer/partial_renderer.rb
  53. +7 7 actionpack/lib/action_view/routing_url_for.rb
  54. +12 12 actionpack/lib/action_view/vendor/html-scanner/html/node.rb
  55. +16 16 activemodel/lib/active_model/errors.rb
  56. +5 5 activemodel/lib/active_model/validations.rb
  57. +2 3 activemodel/lib/active_model/validations/acceptance.rb
  58. +1 2  activemodel/lib/active_model/validations/confirmation.rb
  59. +1 2  activemodel/lib/active_model/validations/exclusion.rb
  60. +1 2  activemodel/lib/active_model/validations/format.rb
  61. +1 2  activemodel/lib/active_model/validations/inclusion.rb
  62. +1 2  activemodel/lib/active_model/validations/numericality.rb
  63. +0 1  activemodel/lib/active_model/validations/presence.rb
  64. +5 6 activemodel/lib/active_model/validations/validates.rb
  65. +1 1  activemodel/lib/active_model/validations/with.rb
  66. +1 1  activemodel/lib/active_model/validator.rb
  67. +12 12 activemodel/test/cases/validations/i18n_generate_message_validation_test.rb
  68. +1 1  activemodel/test/cases/validations/validates_test.rb
  69. +1 1  activerecord/lib/active_record/associations/association.rb
  70. +3 3 activerecord/lib/active_record/associations/preloader.rb
  71. +1 1  activerecord/lib/active_record/associations/singular_association.rb
  72. +1 1  activerecord/lib/active_record/associations/through_association.rb
  73. +15 10 activerecord/lib/active_record/attribute_methods.rb
  74. +43 0 activerecord/lib/active_record/attribute_methods/before_type_cast.rb
  75. +6 8 activerecord/lib/active_record/callbacks.rb
  76. +1 1  activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb
  77. +21 21 activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
  78. +24 24 activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
  79. +2 2 activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
  80. +1 1  activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb
  81. +1 1  activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb
  82. +11 0 activerecord/lib/active_record/errors.rb
  83. +1 0  activerecord/lib/active_record/fixtures.rb
  84. +3 3 activerecord/lib/active_record/nested_attributes.rb
  85. +9 9 activerecord/lib/active_record/persistence.rb
  86. +12 12 activerecord/lib/active_record/reflection.rb
  87. +5 5 activerecord/lib/active_record/relation.rb
  88. +1 1  activesupport/lib/active_support/core_ext/array/wrap.rb
  89. +3 3 activesupport/lib/active_support/core_ext/hash/deep_merge.rb
  90. +3 3 activesupport/lib/active_support/core_ext/hash/slice.rb
  91. +2 2 activesupport/lib/active_support/core_ext/string/inflections.rb
  92. +4 0 guides/source/3_1_release_notes.md
  93. +1 1  guides/source/action_controller_overview.md
  94. +2 2 guides/source/active_record_querying.md
  95. +2 2 guides/source/active_record_validations_callbacks.md
  96. +18 18 guides/source/active_support_core_extensions.md
  97. +2 2 guides/source/active_support_instrumentation.md
  98. +3 0  guides/source/asset_pipeline.md
  99. +1 1  guides/source/configuring.md
  100. +1 0  guides/source/contributing_to_ruby_on_rails.md
  101. +1 1  guides/source/i18n.md
  102. +3 3 guides/source/layouts_and_rendering.md
  103. +3 2 guides/source/migrations.md
  104. +4 0 guides/source/upgrading_ruby_on_rails.md
  105. +1 0  guides/source/working_with_javascript_in_rails.md
4 actionpack/lib/action_controller/metal.rb
@@ -5,7 +5,7 @@ module ActionController
5 5 # allowing the following syntax in controllers:
6 6 #
7 7 # class PostsController < ApplicationController
8   - # use AuthenticationMiddleware, :except => [:index, :show]
  8 + # use AuthenticationMiddleware, except: [:index, :show]
9 9 # end
10 10 #
11 11 class MiddlewareStack < ActionDispatch::MiddlewareStack #:nodoc:
@@ -56,7 +56,7 @@ def build(action, app=nil, &block)
56 56 # And then to route requests to your metal controller, you would add
57 57 # something like this to <tt>config/routes.rb</tt>:
58 58 #
59   - # match 'hello', :to => HelloController.action(:index)
  59 + # match 'hello', to: HelloController.action(:index)
60 60 #
61 61 # The +action+ method returns a valid Rack application for the \Rails
62 62 # router to dispatch to.
2  actionpack/lib/action_controller/metal/conditional_get.rb
@@ -64,7 +64,7 @@ def etag(&etagger)
64 64 #
65 65 # def show
66 66 # @article = Article.find(params[:id])
67   - # fresh_when(@article, :public => true)
  67 + # fresh_when(@article, public: true)
68 68 # end
69 69 def fresh_when(record_or_options, additional_options = {})
70 70 if record_or_options.is_a? Hash
10 actionpack/lib/action_controller/metal/data_streaming.rb
@@ -47,11 +47,11 @@ module DataStreaming
47 47 #
48 48 # Show a JPEG in the browser:
49 49 #
50   - # send_file '/path/to.jpeg', :type => 'image/jpeg', :disposition => 'inline'
  50 + # send_file '/path/to.jpeg', type: 'image/jpeg', disposition: 'inline'
51 51 #
52 52 # Show a 404 page in the browser:
53 53 #
54   - # send_file '/path/to/404.html', :type => 'text/html; charset=utf-8', :status => 404
  54 + # send_file '/path/to/404.html', type: 'text/html; charset=utf-8', status: 404
55 55 #
56 56 # Read about the other Content-* HTTP headers if you'd like to
57 57 # provide the user with more information (such as Content-Description) in
@@ -96,7 +96,7 @@ def each
96 96 end
97 97
98 98 # Sends the given binary data to the browser. This method is similar to
99   - # <tt>render :text => data</tt>, but also allows you to specify whether
  99 + # <tt>render text: data</tt>, but also allows you to specify whether
100 100 # the browser should display the response as a file attachment (i.e. in a
101 101 # download dialog) or as inline data. You may also set the content type,
102 102 # the apparent file name, and other things.
@@ -117,11 +117,11 @@ def each
117 117 #
118 118 # Download a dynamically-generated tarball:
119 119 #
120   - # send_data generate_tgz('dir'), :filename => 'dir.tgz'
  120 + # send_data generate_tgz('dir'), filename: 'dir.tgz'
121 121 #
122 122 # Display an image Active Record in the browser:
123 123 #
124   - # send_data image.data, :type => image.content_type, :disposition => 'inline'
  124 + # send_data image.data, type: image.content_type, disposition: 'inline'
125 125 #
126 126 # See +send_file+ for more information on HTTP Content-* headers and caching.
127 127 def send_data(data, options = {}) #:doc:
2  actionpack/lib/action_controller/metal/force_ssl.rb
@@ -22,7 +22,7 @@ module ClassMethods
22 22 # an +:if+ or +:unless+ condition.
23 23 #
24 24 # class AccountsController < ApplicationController
25   - # force_ssl :if => :ssl_configured?
  25 + # force_ssl if: :ssl_configured?
26 26 #
27 27 # def ssl_configured?
28 28 # !Rails.env.development?
4 actionpack/lib/action_controller/metal/head.rb
@@ -7,9 +7,9 @@ module Head
7 7 # This allows you to easily return a response that consists only of
8 8 # significant headers:
9 9 #
10   - # head :created, :location => person_path(@person)
  10 + # head :created, location: person_path(@person)
11 11 #
12   - # head :created, :location => @person
  12 + # head :created, location: @person
13 13 #
14 14 # It can also be used to return exceptional conditions:
15 15 #
20 actionpack/lib/action_controller/metal/http_authentication.rb
@@ -8,14 +8,14 @@ module HttpAuthentication
8 8 # === Simple \Basic example
9 9 #
10 10 # class PostsController < ApplicationController
11   - # http_basic_authenticate_with :name => "dhh", :password => "secret", :except => :index
  11 + # http_basic_authenticate_with name: "dhh", password: "secret", except: :index
12 12 #
13 13 # def index
14   - # render :text => "Everyone can see me!"
  14 + # render text: "Everyone can see me!"
15 15 # end
16 16 #
17 17 # def edit
18   - # render :text => "I'm only accessible if you know the password"
  18 + # render text: "I'm only accessible if you know the password"
19 19 # end
20 20 # end
21 21 #
@@ -124,14 +124,14 @@ def authentication_request(controller, realm)
124 124 # USERS = {"dhh" => "secret", #plain text password
125 125 # "dap" => Digest::MD5.hexdigest(["dap",REALM,"secret"].join(":"))} #ha1 digest password
126 126 #
127   - # before_filter :authenticate, :except => [:index]
  127 + # before_filter :authenticate, except: [:index]
128 128 #
129 129 # def index
130   - # render :text => "Everyone can see me!"
  130 + # render text: "Everyone can see me!"
131 131 # end
132 132 #
133 133 # def edit
134   - # render :text => "I'm only accessible if you know the password"
  134 + # render text: "I'm only accessible if you know the password"
135 135 # end
136 136 #
137 137 # private
@@ -317,14 +317,14 @@ def opaque(secret_key)
317 317 # class PostsController < ApplicationController
318 318 # TOKEN = "secret"
319 319 #
320   - # before_filter :authenticate, :except => [ :index ]
  320 + # before_filter :authenticate, except: [ :index ]
321 321 #
322 322 # def index
323   - # render :text => "Everyone can see me!"
  323 + # render text: "Everyone can see me!"
324 324 # end
325 325 #
326 326 # def edit
327   - # render :text => "I'm only accessible if you know the password"
  327 + # render text: "I'm only accessible if you know the password"
328 328 # end
329 329 #
330 330 # private
@@ -424,7 +424,7 @@ def authenticate(controller, &login_procedure)
424 424 # Parses the token and options out of the token authorization header. If
425 425 # the header looks like this:
426 426 # Authorization: Token token="abc", nonce="def"
427   - # Then the returned token is "abc", and the options is {:nonce => "def"}
  427 + # Then the returned token is "abc", and the options is {nonce: "def"}
428 428 #
429 429 # request - ActionDispatch::Request instance with the current headers.
430 430 #
26 actionpack/lib/action_controller/metal/mime_responds.rb
@@ -23,13 +23,13 @@ module ClassMethods
23 23 # <tt>:except</tt> with an array of actions or a single action:
24 24 #
25 25 # respond_to :html
26   - # respond_to :xml, :json, :except => [ :edit ]
  26 + # respond_to :xml, :json, except: [ :edit ]
27 27 #
28 28 # This specifies that all actions respond to <tt>:html</tt>
29 29 # and all actions except <tt>:edit</tt> respond to <tt>:xml</tt> and
30 30 # <tt>:json</tt>.
31 31 #
32   - # respond_to :json, :only => :create
  32 + # respond_to :json, only: :create
33 33 #
34 34 # This specifies that the <tt>:create</tt> action and no other responds
35 35 # to <tt>:json</tt>.
@@ -70,7 +70,7 @@ def clear_respond_to
70 70 #
71 71 # respond_to do |format|
72 72 # format.html
73   - # format.xml { render :xml => @people }
  73 + # format.xml { render xml: @people }
74 74 # end
75 75 # end
76 76 #
@@ -98,7 +98,7 @@ def clear_respond_to
98 98 # respond_to do |format|
99 99 # format.html { redirect_to(person_list_url) }
100 100 # format.js
101   - # format.xml { render :xml => @person.to_xml(:include => @company) }
  101 + # format.xml { render xml: @person.to_xml(include: @company) }
102 102 # end
103 103 # end
104 104 #
@@ -162,11 +162,11 @@ def clear_respond_to
162 162 #
163 163 # In the example above, if the format is xml, it will render:
164 164 #
165   - # render :xml => @people
  165 + # render xml: @people
166 166 #
167 167 # Or if the format is json:
168 168 #
169   - # render :json => @people
  169 + # render json: @people
170 170 #
171 171 # Since this is a common pattern, you can use the class method respond_to
172 172 # with the respond_with method to have the same results:
@@ -246,10 +246,10 @@ def respond_to(*mimes, &block)
246 246 # if @user.save
247 247 # flash[:notice] = 'User was successfully created.'
248 248 # format.html { redirect_to(@user) }
249   - # format.xml { render :xml => @user }
  249 + # format.xml { render xml: @user }
250 250 # else
251   - # format.html { render :action => "new" }
252   - # format.xml { render :xml => @user }
  251 + # format.html { render action: "new" }
  252 + # format.xml { render xml: @user }
253 253 # end
254 254 # end
255 255 # end
@@ -259,8 +259,8 @@ def respond_to(*mimes, &block)
259 259 # * for other requests - i.e. data formats such as xml, json, csv etc, if
260 260 # the resource passed to +respond_with+ responds to <code>to_<format></code>,
261 261 # the method attempts to render the resource in the requested format
262   - # directly, e.g. for an xml request, the response is equivalent to calling
263   - # <code>render :xml => resource</code>.
  262 + # directly, e.g. for an xml request, the response is equivalent to calling
  263 + # <code>render xml: resource</code>.
264 264 #
265 265 # === Nested resources
266 266 #
@@ -309,7 +309,7 @@ def respond_to(*mimes, &block)
309 309 # Also, a hash passed to +respond_with+ immediately after the specified
310 310 # resource(s) is interpreted as a set of options relevant to all
311 311 # formats. Any option accepted by +render+ can be used, e.g.
312   - # respond_with @people, :status => 200
  312 + # respond_with @people, status: 200
313 313 # However, note that these options are ignored after an unsuccessful attempt
314 314 # to save a resource, e.g. when automatically rendering <tt>:new</tt>
315 315 # after a post request.
@@ -381,7 +381,7 @@ def retrieve_collector_from_mimes(mimes=nil, &block) #:nodoc:
381 381 #
382 382 # respond_to do |format|
383 383 # format.html
384   - # format.xml { render :xml => @people }
  384 + # format.xml { render xml: @people }
385 385 # end
386 386 #
387 387 # In this usage, the argument passed to the block (+format+ above) is an
4 actionpack/lib/action_controller/metal/params_wrapper.rb
@@ -82,7 +82,7 @@ module ClassMethods
82 82 # would use to determine the attribute names from.
83 83 #
84 84 # ==== Examples
85   - # wrap_parameters :format => :xml
  85 + # wrap_parameters format: :xml
86 86 # # enables the parameter wrapper for XML format
87 87 #
88 88 # wrap_parameters :person
@@ -92,7 +92,7 @@ module ClassMethods
92 92 # # wraps parameters by determining the wrapper key from Person class
93 93 # (+person+, in this case) and the list of attribute names
94 94 #
95   - # wrap_parameters :include => [:username, :title]
  95 + # wrap_parameters include: [:username, :title]
96 96 # # wraps only +:username+ and +:title+ attributes from parameters.
97 97 #
98 98 # wrap_parameters false
22 actionpack/lib/action_controller/metal/redirecting.rb
@@ -24,7 +24,7 @@ module Redirecting
24 24 # * <tt>:back</tt> - Back to the page that issued the request. Useful for forms that are triggered from multiple places.
25 25 # Short-hand for <tt>redirect_to(request.env["HTTP_REFERER"])</tt>
26 26 #
27   - # redirect_to :action => "show", :id => 5
  27 + # redirect_to action: "show", id: 5
28 28 # redirect_to post
29 29 # redirect_to "http://www.rubyonrails.org"
30 30 # redirect_to "/images/screenshot.jpg"
@@ -34,10 +34,10 @@ module Redirecting
34 34 #
35 35 # The redirection happens as a "302 Moved" header unless otherwise specified.
36 36 #
37   - # redirect_to post_url(@post), :status => :found
38   - # redirect_to :action=>'atom', :status => :moved_permanently
39   - # redirect_to post_url(@post), :status => 301
40   - # redirect_to :action=>'atom', :status => 302
  37 + # redirect_to post_url(@post), status: :found
  38 + # redirect_to action: 'atom', status: :moved_permanently
  39 + # redirect_to post_url(@post), status: 301
  40 + # redirect_to action: 'atom', status: 302
41 41 #
42 42 # The status code can either be a standard {HTTP Status code}[http://www.iana.org/assignments/http-status-codes] as an
43 43 # integer, or a symbol representing the downcased, underscored and symbolized description.
@@ -49,16 +49,16 @@ module Redirecting
49 49 # around this you can return a <tt>303 See Other</tt> status code which will be
50 50 # followed using a GET request.
51 51 #
52   - # redirect_to posts_url, :status => :see_other
53   - # redirect_to :action => 'index', :status => 303
  52 + # redirect_to posts_url, status: :see_other
  53 + # redirect_to action: 'index', status: 303
54 54 #
55 55 # It is also possible to assign a flash message as part of the redirection. There are two special accessors for the commonly used flash names
56 56 # +alert+ and +notice+ as well as a general purpose +flash+ bucket.
57 57 #
58   - # redirect_to post_url(@post), :alert => "Watch it, mister!"
59   - # redirect_to post_url(@post), :status=> :found, :notice => "Pay attention to the road"
60   - # redirect_to post_url(@post), :status => 301, :flash => { :updated_post_id => @post.id }
61   - # redirect_to { :action=>'atom' }, :alert => "Something serious happened"
  58 + # redirect_to post_url(@post), alert: "Watch it, mister!"
  59 + # redirect_to post_url(@post), status: :found, notice: "Pay attention to the road"
  60 + # redirect_to post_url(@post), status: 301, flash: { updated_post_id: @post.id }
  61 + # redirect_to { action: 'atom' }, alert: "Something serious happened"
62 62 #
63 63 # When using <tt>redirect_to :back</tt>, if there is no referrer, ActionController::RedirectBackError will be raised. You may specify some fallback
64 64 # behavior for this case by rescuing ActionController::RedirectBackError.
6 actionpack/lib/action_controller/metal/renderers.rb
@@ -52,8 +52,8 @@ def _handle_render_options(options)
52 52 # ActionController::Renderers.add :csv do |obj, options|
53 53 # filename = options[:filename] || 'data'
54 54 # str = obj.respond_to?(:to_csv) ? obj.to_csv : obj.to_s
55   - # send_data str, :type => Mime::CSV,
56   - # :disposition => "attachment; filename=#{filename}.csv"
  55 + # send_data str, type: Mime::CSV,
  56 + # disposition: "attachment; filename=#{filename}.csv"
57 57 # end
58 58 #
59 59 # Note that we used Mime::CSV for the csv mime type as it comes with Rails.
@@ -66,7 +66,7 @@ def _handle_render_options(options)
66 66 # @csvable = Csvable.find(params[:id])
67 67 # respond_to do |format|
68 68 # format.html
69   - # format.csv { render :csv => @csvable, :filename => @csvable.name }
  69 + # format.csv { render csv: @csvable, filename: @csvable.name }
70 70 # }
71 71 # end
72 72 # To use renderers and their mime types in more concise ways, see
6 actionpack/lib/action_controller/metal/request_forgery_protection.rb
@@ -19,7 +19,7 @@ class InvalidAuthenticityToken < ActionControllerError #:nodoc:
19 19 #
20 20 # class ApplicationController < ActionController::Base
21 21 # protect_from_forgery
22   - # skip_before_filter :verify_authenticity_token, :if => :json_request?
  22 + # skip_before_filter :verify_authenticity_token, if: :json_request?
23 23 #
24 24 # protected
25 25 #
@@ -62,7 +62,7 @@ module ClassMethods
62 62 # Turn on request forgery protection. Bear in mind that only non-GET, HTML/JavaScript requests are checked.
63 63 #
64 64 # class FooController < ApplicationController
65   - # protect_from_forgery :except => :index
  65 + # protect_from_forgery except: :index
66 66 #
67 67 # You can disable csrf protection on controller-by-controller basis:
68 68 #
@@ -70,7 +70,7 @@ module ClassMethods
70 70 #
71 71 # It can also be disabled for specific controller actions:
72 72 #
73   - # skip_before_filter :verify_authenticity_token, :except => [:create]
  73 + # skip_before_filter :verify_authenticity_token, except: [:create]
74 74 #
75 75 # Valid Options:
76 76 #
20 actionpack/lib/action_controller/metal/responder.rb
@@ -45,10 +45,10 @@ module ActionController #:nodoc:
45 45 # if @user.save
46 46 # flash[:notice] = 'User was successfully created.'
47 47 # format.html { redirect_to(@user) }
48   - # format.xml { render :xml => @user, :status => :created, :location => @user }
  48 + # format.xml { render xml: @user, status: :created, location: @user }
49 49 # else
50   - # format.html { render :action => "new" }
51   - # format.xml { render :xml => @user.errors, :status => :unprocessable_entity }
  50 + # format.html { render action: "new" }
  51 + # format.xml { render xml: @user.errors, status: :unprocessable_entity }
52 52 # end
53 53 # end
54 54 # end
@@ -92,7 +92,7 @@ module ActionController #:nodoc:
92 92 # @project = Project.find(params[:project_id])
93 93 # @task = @project.tasks.build(params[:task])
94 94 # flash[:notice] = 'Task was successfully created.' if @task.save
95   - # respond_with(@project, @task, :status => 201)
  95 + # respond_with(@project, @task, status: 201)
96 96 # end
97 97 #
98 98 # This will return status 201 if the task was saved successfully. If not,
@@ -103,7 +103,7 @@ module ActionController #:nodoc:
103 103 # def create
104 104 # @project = Project.find(params[:project_id])
105 105 # @task = @project.tasks.build(params[:task])
106   - # respond_with(@project, @task, :status => 201) do |format|
  106 + # respond_with(@project, @task, status: 201) do |format|
107 107 # if @task.save
108 108 # flash[:notice] = 'Task was successfully created.'
109 109 # else
@@ -236,20 +236,20 @@ def default_render
236 236
237 237 # Display is just a shortcut to render a resource with the current format.
238 238 #
239   - # display @user, :status => :ok
  239 + # display @user, status: :ok
240 240 #
241 241 # For XML requests it's equivalent to:
242 242 #
243   - # render :xml => @user, :status => :ok
  243 + # render xml: @user, status: :ok
244 244 #
245 245 # Options sent by the user are also used:
246 246 #
247   - # respond_with(@user, :status => :created)
248   - # display(@user, :status => :ok)
  247 + # respond_with(@user, status: :created)
  248 + # display(@user, status: :ok)
249 249 #
250 250 # Results in:
251 251 #
252   - # render :xml => @user, :status => :created
  252 + # render xml: @user, status: :created
253 253 #
254 254 def display(resource, given_options={})
255 255 controller.render given_options.merge!(options).merge!(format => resource)
6 actionpack/lib/action_controller/metal/streaming.rb
@@ -29,7 +29,7 @@ module ActionController #:nodoc:
29 29 # class PostsController
30 30 # def index
31 31 # @posts = Post.scoped
32   - # render :stream => true
  32 + # render stream: true
33 33 # end
34 34 # end
35 35 #
@@ -56,7 +56,7 @@ module ActionController #:nodoc:
56 56 # @posts = Post.scoped
57 57 # @pages = Page.scoped
58 58 # @articles = Article.scoped
59   - # render :stream => true
  59 + # render stream: true
60 60 # end
61 61 #
62 62 # Notice that :stream only works with templates. Rendering :json
@@ -176,7 +176,7 @@ module ActionController #:nodoc:
176 176 # need to create a config file as follow:
177 177 #
178 178 # # unicorn.config.rb
179   - # listen 3000, :tcp_nopush => false
  179 + # listen 3000, tcp_nopush: false
180 180 #
181 181 # And use it on initialization:
182 182 #
2  actionpack/lib/action_controller/metal/strong_parameters.rb
@@ -361,7 +361,7 @@ def each_element(object)
361 361 # # It's mandatory to specify the nested attributes that should be whitelisted.
362 362 # # If you use `permit` with just the key that points to the nested attributes hash,
363 363 # # it will return an empty hash.
364   - # params.require(:person).permit(:name, :age, pets_attributes: { :name, :category })
  364 + # params.require(:person).permit(:name, :age, pets_attributes: [ :name, :category ])
365 365 # end
366 366 # end
367 367 #
2  actionpack/lib/action_controller/metal/url_for.rb
@@ -10,7 +10,7 @@ module ActionController
10 10 # include ActionController::UrlFor
11 11 # include Rails.application.routes.url_helpers
12 12 #
13   - # delegate :env, :request, :to => :controller
  13 + # delegate :env, :request, to: :controller
14 14 #
15 15 # def initialize(controller)
16 16 # @controller = controller
22 actionpack/lib/action_controller/test_case.rb
@@ -61,25 +61,25 @@ def process(*args)
61 61 # assert_template %r{\Aadmin/posts/new\Z}
62 62 #
63 63 # # assert that the layout 'admin' was rendered
64   - # assert_template :layout => 'admin'
65   - # assert_template :layout => 'layouts/admin'
66   - # assert_template :layout => :admin
  64 + # assert_template layout: 'admin'
  65 + # assert_template layout: 'layouts/admin'
  66 + # assert_template layout: :admin
67 67 #
68 68 # # assert that no layout was rendered
69   - # assert_template :layout => nil
70   - # assert_template :layout => false
  69 + # assert_template layout: nil
  70 + # assert_template layout: false
71 71 #
72 72 # # assert that the "_customer" partial was rendered twice
73   - # assert_template :partial => '_customer', :count => 2
  73 + # assert_template partial: '_customer', count: 2
74 74 #
75 75 # # assert that no partials were rendered
76   - # assert_template :partial => false
  76 + # assert_template partial: false
77 77 #
78 78 # In a view test case, you can also assert that specific locals are passed
79 79 # to partials:
80 80 #
81 81 # # assert that the "_customer" partial was rendered with a specific object
82   - # assert_template :partial => '_customer', :locals => { :customer => @customer }
  82 + # assert_template partial: '_customer', locals: { customer: @customer }
83 83 def assert_template(options = {}, message = nil)
84 84 # Force body to be read in case the
85 85 # template is being streamed
@@ -267,7 +267,7 @@ def exists?
267 267 # class BooksControllerTest < ActionController::TestCase
268 268 # def test_create
269 269 # # Simulate a POST response with the given HTTP parameters.
270   - # post(:create, :book => { :title => "Love Hina" })
  270 + # post(:create, book: { title: "Love Hina" })
271 271 #
272 272 # # Assert that the controller tried to redirect us to
273 273 # # the created book's URI.
@@ -281,7 +281,7 @@ def exists?
281 281 # You can also send a real document in the simulated HTTP request.
282 282 #
283 283 # def test_create
284   - # json = {:book => { :title => "Love Hina" }}.to_json
  284 + # json = {book: { title: "Love Hina" }}.to_json
285 285 # post :create, json
286 286 # end
287 287 #
@@ -356,7 +356,7 @@ def exists?
356 356 #
357 357 # If you're using named routes, they can be easily tested using the original named routes' methods straight in the test case.
358 358 #
359   - # assert_redirected_to page_url(:title => 'foo')
  359 + # assert_redirected_to page_url(title: 'foo')
360 360 class TestCase < ActiveSupport::TestCase
361 361
362 362 # Use AC::TestCase for the base class when describing a controller
4 actionpack/lib/action_dispatch/http/mime_type.rb
@@ -44,8 +44,8 @@ def fetch(type)
44 44 #
45 45 # respond_to do |format|
46 46 # format.html
47   - # format.ics { render :text => post.to_ics, :mime_type => Mime::Type["text/calendar"] }
48   - # format.xml { render :xml => @people }
  47 + # format.ics { render text: post.to_ics, mime_type: Mime::Type["text/calendar"] }
  48 + # format.xml { render xml: @people }
49 49 # end
50 50 # end
51 51 # end
14 actionpack/lib/action_dispatch/middleware/cookies.rb
@@ -24,7 +24,7 @@ def cookie_jar
24 24 # cookies[:lat_lon] = [47.68, -122.37]
25 25 #
26 26 # # Sets a cookie that expires in 1 hour.
27   - # cookies[:login] = { :value => "XJ-122", :expires => 1.hour.from_now }
  27 + # cookies[:login] = { value: "XJ-122", expires: 1.hour.from_now }
28 28 #
29 29 # # Sets a signed cookie, which prevents users from tampering with its value.
30 30 # # The cookie is signed by your app's <tt>config.secret_token</tt> value.
@@ -51,12 +51,12 @@ def cookie_jar
51 51 # Please note that if you specify a :domain when setting a cookie, you must also specify the domain when deleting the cookie:
52 52 #
53 53 # cookies[:key] = {
54   - # :value => 'a yummy cookie',
55   - # :expires => 1.year.from_now,
56   - # :domain => 'domain.com'
  54 + # value: 'a yummy cookie',
  55 + # expires: 1.year.from_now,
  56 + # domain: 'domain.com'
57 57 # }
58 58 #
59   - # cookies.delete(:key, :domain => 'domain.com')
  59 + # cookies.delete(:key, domain: 'domain.com')
60 60 #
61 61 # The option symbols for setting cookies are:
62 62 #
@@ -69,8 +69,8 @@ def cookie_jar
69 69 # to <tt>:all</tt>. Make sure to specify the <tt>:domain</tt> option with
70 70 # <tt>:all</tt> again when deleting keys.
71 71 #
72   - # :domain => nil # Does not sets cookie domain. (default)
73   - # :domain => :all # Allow the cookie for the top most level
  72 + # domain: nil # Does not sets cookie domain. (default)
  73 + # domain: :all # Allow the cookie for the top most level
74 74 # domain and subdomains.
75 75 #
76 76 # * <tt>:expires</tt> - The time at which this cookie expires, as a \Time object.
4 actionpack/lib/action_dispatch/middleware/session/cookie_store.rb
@@ -28,8 +28,8 @@ module Session
4 actionpack/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb
@@ -6,5 +6,5 @@
6 6 </h1>
7 7 <pre><%=h @exception.message %></pre>
8 8
9   -<%= render :template => "rescues/_trace" %>
10   -<%= render :template => "rescues/_request_and_response" %>
  9 +<%= render template: "rescues/_trace" %>
  10 +<%= render template: "rescues/_request_and_response" %>
2  actionpack/lib/action_dispatch/middleware/templates/rescues/routing_error.erb
@@ -10,7 +10,7 @@
10 10 </ol>
11 11 </p>
12 12 <% end %>
13   -<%= render :template => "rescues/_trace" %>
  13 +<%= render template: "rescues/_trace" %>
14 14
15 15 <h2>
16 16 Routes
4 actionpack/lib/action_dispatch/middleware/templates/rescues/template_error.erb
@@ -13,5 +13,5 @@
13 13
14 14 <p><%=h @exception.sub_template_message %></p>
15 15
16   -<%= render :template => "rescues/_trace" %>
17   -<%= render :template => "rescues/_request_and_response" %>
  16 +<%= render template: "rescues/_trace" %>
  17 +<%= render template: "rescues/_request_and_response" %>
48 actionpack/lib/action_dispatch/routing.rb
@@ -61,7 +61,7 @@ module ActionDispatch
61 61 # directory by using +scope+. +scope+ takes additional options which
62 62 # apply to all enclosed routes.
63 63 #
64   - # scope :path => "/cpanel", :as => 'admin' do
  64 + # scope path: "/cpanel", as: 'admin' do
65 65 # resources :posts, :comments
66 66 # end
67 67 #
@@ -78,22 +78,22 @@ module ActionDispatch
78 78 # Example:
79 79 #
80 80 # # In routes.rb
81   - # match '/login' => 'accounts#login', :as => 'login'
  81 + # match '/login' => 'accounts#login', as: 'login'
82 82 #
83 83 # # With render, redirect_to, tests, etc.
84 84 # redirect_to login_url
85 85 #
86 86 # Arguments can be passed as well.
87 87 #
88   - # redirect_to show_item_path(:id => 25)
  88 + # redirect_to show_item_path(id: 25)
89 89 #
90 90 # Use <tt>root</tt> as a shorthand to name a route for the root path "/".
91 91 #
92 92 # # In routes.rb
93   - # root :to => 'blogs#index'
  93 + # root to: 'blogs#index'
94 94 #
95 95 # # would recognize http://www.example.com/ as
96   - # params = { :controller => 'blogs', :action => 'index' }
  96 + # params = { controller: 'blogs', action: 'index' }
97 97 #
98 98 # # and provide these named routes
99 99 # root_url # => 'http://www.example.com/'
@@ -110,43 +110,43 @@ module ActionDispatch
110 110 # end
111 111 #
112 112 # # provides named routes for show, delete, and edit
113   - # link_to @article.title, show_path(:id => @article.id)
  113 + # link_to @article.title, show_path(id: @article.id)
114 114 #
115 115 # == Pretty URLs
116 116 #
117 117 # Routes can generate pretty URLs. For example:
118 118 #
119   - # match '/articles/:year/:month/:day' => 'articles#find_by_id', :constraints => {
120   - # :year => /\d{4}/,
121   - # :month => /\d{1,2}/,
122   - # :day => /\d{1,2}/
  119 + # match '/articles/:year/:month/:day' => 'articles#find_by_id', constraints: {
  120 + # year: /\d{4}/,
  121 + # month: /\d{1,2}/,
  122 + # day: /\d{1,2}/
123 123 # }
124 124 #
125 125 # Using the route above, the URL "http://localhost:3000/articles/2005/11/06"
126 126 # maps to
127 127 #
128   - # params = {:year => '2005', :month => '11', :day => '06'}
  128 + # params = {year: '2005', month: '11', day: '06'}
129 129 #
130 130 # == Regular Expressions and parameters
131 131 # You can specify a regular expression to define a format for a parameter.
132 132 #
133 133 # controller 'geocode' do
134   - # match 'geocode/:postalcode' => :show, :constraints => {
135   - # :postalcode => /\d{5}(-\d{4})?/
  134 + # match 'geocode/:postalcode' => :show, constraints: {
  135 + # postalcode: /\d{5}(-\d{4})?/
136 136 # }
137 137 #
138 138 # Constraints can include the 'ignorecase' and 'extended syntax' regular
139 139 # expression modifiers:
140 140 #
141 141 # controller 'geocode' do
142   - # match 'geocode/:postalcode' => :show, :constraints => {
143   - # :postalcode => /hx\d\d\s\d[a-z]{2}/i
  142 + # match 'geocode/:postalcode' => :show, constraints: {
  143 + # postalcode: /hx\d\d\s\d[a-z]{2}/i
144 144 # }
145 145 # end
146 146 #
147 147 # controller 'geocode' do
148   - # match 'geocode/:postalcode' => :show, :constraints => {
149   - # :postalcode => /# Postcode format
  148 + # match 'geocode/:postalcode' => :show, constraints: {
  149 + # postalcode: /# Postcode format
150 150 # \d{5} #Prefix
151 151 # (-\d{4})? #Suffix
152 152 # /x
@@ -172,9 +172,9 @@ module ActionDispatch
172 172 # Suppose you get an incoming request for <tt>/blog/edit/22</tt>, you'll end
173 173 # up with:
174 174 #
175   - # params = { :controller => 'blog',
176   - # :action => 'edit',
177   - # :id => '22'
  175 + # params = { controller: 'blog',
  176 + # action: 'edit',
  177 + # id: '22'
178 178 # }
179 179 #
180 180 # By not relying on default routes, you improve the security of your
@@ -193,8 +193,8 @@ module ActionDispatch
193 193 #
194 194 # Examples:
195 195 #
196   - # match 'post/:id' => 'posts#show', :via => :get
197   - # match 'post/:id' => 'posts#create_comment', :via => :post
  196 + # match 'post/:id' => 'posts#show', via: :get
  197 + # match 'post/:id' => 'posts#create_comment', via: :post
198 198 #
199 199 # Now, if you POST to <tt>/posts/:id</tt>, it will route to the <tt>create_comment</tt> action. A GET on the same
200 200 # URL will route to the <tt>show</tt> action.
@@ -249,7 +249,7 @@ module ActionDispatch
249 249 # === +assert_routing+
250 250 #
251 251 # def test_movie_route_properly_splits
252   - # opts = {:controller => "plugin", :action => "checkout", :id => "2"}
  252 + # opts = {controller: "plugin", action: "checkout", id: "2"}
253 253 # assert_routing "plugin/checkout/2", opts
254 254 # end
255 255 #
@@ -258,7 +258,7 @@ module ActionDispatch
258 258 # === +assert_recognizes+
259 259 #
260 260 # def test_route_has_options
261   - # opts = {:controller => "plugin", :action => "show", :id => "12"}
  261 + # opts = {controller: "plugin", action: "show", id: "12"}
262 262 # assert_recognizes opts, "/plugins/show/12"
263 263 # end
264 264 #
110 actionpack/lib/action_dispatch/routing/mapper.rb
@@ -121,7 +121,7 @@ def normalize_path(path)
121 121 # Add a default constraint for :controller path segments that matches namespaced
122 122 # controllers with default routes like :controller/:action/:id(.:format), e.g:
123 123 # GET /admin/products/show/1
124   - # => { :controller => 'admin/products', :action => 'show', :id => '1' }
  124 + # => { controller: 'admin/products', action: 'show', id: '1' }
125 125 @options[:controller] ||= /.+?/
126 126 end
127 127
@@ -272,7 +272,7 @@ def self.normalize_name(name)
272 272 module Base
273 273 # You can specify what Rails should route "/" to with the root method:
274 274 #
275   - # root :to => 'pages#main'
  275 + # root to: 'pages#main'
276 276 #
277 277 # For options, see +match+, as +root+ uses it internally.
278 278 #
@@ -309,8 +309,8 @@ def root(options = {})
309 309 # +:controller+ should be set in options or hash shorthand. Examples:
310 310 #
311 311 # match 'photos/:id' => 'photos#show'
312   - # match 'photos/:id', :to => 'photos#show'
313   - # match 'photos/:id', :controller => 'photos', :action => 'show'
  312 + # match 'photos/:id', to: 'photos#show'
  313 + # match 'photos/:id', controller: 'photos', action: 'show'
314 314 #
315 315 # A pattern can also point to a +Rack+ endpoint i.e. anything that
316 316 # responds to +call+:
@@ -336,7 +336,7 @@ def root(options = {})
336 336 # [:module]
337 337 # The namespace for :controller.
338 338 #
339   - # match 'path' => 'c#a', :module => 'sekret', :controller => 'posts'
  339 + # match 'path' => 'c#a', module: 'sekret', controller: 'posts'
340 340 # #=> Sekret::PostsController
341 341 #
342 342 # See <tt>Scoping#namespace</tt> for its scope equivalent.
@@ -347,16 +347,16 @@ def root(options = {})
347 347 # [:via]
348 348 # Allowed HTTP verb(s) for route.
349 349 #
350   - # match 'path' => 'c#a', :via => :get
351   - # match 'path' => 'c#a', :via => [:get, :post]
  350 + # match 'path' => 'c#a', via: :get
  351 + # match 'path' => 'c#a', via: [:get, :post]
352 352 #
353 353 # [:to]
354 354 # Points to a +Rack+ endpoint. Can be an object that responds to
355 355 # +call+ or a string representing a controller's action.
356 356 #
357   - # match 'path', :to => 'controller#action'
358   - # match 'path', :to => lambda { |env| [200, {}, "Success!"] }
359   - # match 'path', :to => RackApp
  357 + # match 'path', to: 'controller#action'
  358 + # match 'path', to: lambda { |env| [200, {}, "Success!"] }
  359 + # match 'path', to: RackApp
360 360 #
361 361 # [:on]
362 362 # Shorthand for wrapping routes in a specific RESTful context. Valid
@@ -364,14 +364,14 @@ def root(options = {})
364 364 # <tt>resource(s)</tt> block. For example:
365 365 #
366 366 # resource :bar do
367   - # match 'foo' => 'c#a', :on => :member, :via => [:get, :post]
  367 + # match 'foo' => 'c#a', on: :member, via: [:get, :post]
368 368 # end
369 369 #
370 370 # Is equivalent to:
371 371 #
372 372 # resource :bar do
373 373 # member do
374   - # match 'foo' => 'c#a', :via => [:get, :post]
  374 + # match 'foo' => 'c#a', via: [:get, :post]
375 375 # end
376 376 # end
377 377 #
@@ -379,12 +379,12 @@ def root(options = {})
379 379 # Constrains parameters with a hash of regular expressions or an
380 380 # object that responds to <tt>matches?</tt>
381 381 #
382   - # match 'path/:id', :constraints => { :id => /[A-Z]\d{5}/ }
  382 + # match 'path/:id', constraints: { id: /[A-Z]\d{5}/ }
383 383 #
384 384 # class Blacklist
385 385 # def matches?(request) request.remote_ip == '1.2.3.4' end
386 386 # end
387   - # match 'path' => 'c#a', :constraints => Blacklist.new
  387 + # match 'path' => 'c#a', constraints: Blacklist.new
388 388 #
389 389 # See <tt>Scoping#constraints</tt> for more examples with its scope
390 390 # equivalent.
@@ -393,7 +393,7 @@ def root(options = {})
393 393 # Sets defaults for parameters
394 394 #
395 395 # # Sets params[:format] to 'jpg' by default
396   - # match 'path' => 'c#a', :defaults => { :format => 'jpg' }
  396 + # match 'path' => 'c#a', defaults: { format: 'jpg' }
397 397 #
398 398 # See <tt>Scoping#defaults</tt> for its scope equivalent.
399 399 #
@@ -402,7 +402,7 @@ def root(options = {})
402 402 # false, the pattern matches any request prefixed with the given path.
403 403 #
404 404 # # Matches any request starting with 'path'
405   - # match 'path' => 'c#a', :anchor => false
  405 + # match 'path' => 'c#a', anchor: false
406 406 #
407 407 # [:format]
408 408 # Allows you to specify the default value for optional +format+
@@ -412,7 +412,7 @@ def match(path, options=nil)
412 412
413 413 # Mount a Rack-based application to be used within the application.
414 414 #
415   - # mount SomeRackApp, :at => "some_route"
  415 + # mount SomeRackApp, at: "some_route"
416 416 #
417 417 # Alternatively:
418 418 #
@@ -425,7 +425,7 @@ def match(path, options=nil)
425 425 # the helper is either +some_rack_app_path+ or +some_rack_app_url+.
426 426 # To customize this helper's name, use the +:as+ option:
427 427 #
428   - # mount(SomeRackApp => "some_route", :as => "exciting")
  428 + # mount(SomeRackApp => "some_route", as: "exciting")
429 429 #
430 430 # This will generate the +exciting_path+ and +exciting_url+ helpers
431 431 # which can be used to navigate to this mounted app.
@@ -503,7 +503,7 @@ module HttpHelpers
503 503 # Define a route that only recognizes HTTP GET.
504 504 # For supported arguments, see <tt>Base#match</tt>.
505 505 #
506   - # get 'bacon', :to => 'food#bacon'
  506 + # get 'bacon', to: 'food#bacon'
507 507 def get(*args, &block)
508 508 map_method(:get, args, &block)
509 509 end
@@ -511,7 +511,7 @@ def get(*args, &block)
511 511 # Define a route that only recognizes HTTP POST.
512 512 # For supported arguments, see <tt>Base#match</tt>.
513 513 #
514   - # post 'bacon', :to => 'food#bacon'
  514 + # post 'bacon', to: 'food#bacon'
515 515 def post(*args, &block)
516 516 map_method(:post, args, &block)
517 517 end
@@ -519,7 +519,7 @@ def post(*args, &block)
519 519 # Define a route that only recognizes HTTP PATCH.
520 520 # For supported arguments, see <tt>Base#match</tt>.
521 521 #
522   - # patch 'bacon', :to => 'food#bacon'
  522 + # patch 'bacon', to: 'food#bacon'
523 523 def patch(*args, &block)
524 524 map_method(:patch, args, &block)
525 525 end
@@ -527,7 +527,7 @@ def patch(*args, &block)
527 527 # Define a route that only recognizes HTTP PUT.
528 528 # For supported arguments, see <tt>Base#match</tt>.
529 529 #
530   - # put 'bacon', :to => 'food#bacon'
  530 + # put 'bacon', to: 'food#bacon'
531 531 def put(*args, &block)
532 532 map_method(:put, args, &block)
533 533 end
@@ -535,7 +535,7 @@ def put(*args, &block)
535 535 # Define a route that only recognizes HTTP DELETE.
536 536 # For supported arguments, see <tt>Base#match</tt>.
537 537 #
538   - # delete 'broccoli', :to => 'food#broccoli'
  538 + # delete 'broccoli', to: 'food#broccoli'
539 539 def delete(*args, &block)
540 540 map_method(:delete, args, &block)
541 541 end
@@ -574,13 +574,13 @@ def map_method(method, args, &block)
574 574 # If you want to route /posts (without the prefix /admin) to
575 575 # <tt>Admin::PostsController</tt>, you could use
576 576 #
577   - # scope :module => "admin" do
  577 + # scope module: "admin" do
578 578 # resources :posts
579 579 # end
580 580 #
581 581 # or, for a single case
582 582 #
583   - # resources :posts, :module => "admin"
  583 + # resources :posts, module: "admin"
584 584 #
585 585 # If you want to route /admin/posts to +PostsController+
586 586 # (without the Admin:: module prefix), you could use
@@ -591,7 +591,7 @@ def map_method(method, args, &block)
591 591 #
592 592 # or, for a single case
593 593 #
594   - # resources :posts, :path => "/admin/posts"
  594 + # resources :posts, path: "/admin/posts"
595 595 #
596 596 # In each of these cases, the named routes remain the same as if you did
597 597 # not use scope. In the last case, the following paths map to
@@ -609,7 +609,7 @@ module Scoping
609 609 #
610 610 # Take the following route definition as an example:
611 611 #
612   - # scope :path => ":account_id", :as => "account" do
  612 + # scope path: ":account_id", as: "account" do
613 613 # resources :projects
614 614 # end
615 615 #
@@ -624,17 +624,17 @@ module Scoping
624 624 # === Examples
625 625 #
626 626 # # route /posts (without the prefix /admin) to <tt>Admin::PostsController</tt>
627   - # scope :module => "admin" do
  627 + # scope module: "admin" do
628 628 # resources :posts
629 629 # end
630 630 #
631 631 # # prefix the posts resource's requests with '/admin'
632   - # scope :path => "/admin" do
  632 + # scope path: "/admin" do
633 633 # resources :posts
634 634 # end
635 635 #
636 636 # # prefix the routing helper name: +sekret_posts_path+ instead of +posts_path+
637   - # scope :as => "sekret" do
  637 + # scope as: "sekret" do
638 638 # resources :posts