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

Switch to 1.9 hash syntax (guides)

This commit is contained in:
Agis Anastasopoulos 2012-11-16 21:11:34 +02:00
parent e258225c8a
commit d0767ceb00

View file

@ -83,13 +83,13 @@ Rails 4.0 changed how `assert_generates`, `assert_recognizes`, and `assert_routi
Rails 4.0 also changed the way unicode character routes are drawn. Now you can draw unicode character routes directly. If you already draw such routes, you must change them, for example: Rails 4.0 also changed the way unicode character routes are drawn. Now you can draw unicode character routes directly. If you already draw such routes, you must change them, for example:
```ruby ```ruby
get Rack::Utils.escape('こんにちは'), :controller => 'welcome', :action => 'index' get Rack::Utils.escape('こんにちは'), controller: 'welcome', action: 'index'
``` ```
becomes becomes
```ruby ```ruby
get 'こんにちは', :controller => 'welcome', :action => 'index' get 'こんにちは', controller: 'welcome', action: 'index'
``` ```
### Active Support ### Active Support
@ -248,7 +248,7 @@ Add this file with the following contents, if you wish to wrap parameters into a
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
ActiveSupport.on_load(:action_controller) do ActiveSupport.on_load(:action_controller) do
wrap_parameters :format => [:json] wrap_parameters format: [:json]
end end
# Disable root element in JSON by default. # Disable root element in JSON by default.
@ -263,7 +263,7 @@ You need to change your session key to something new, or remove all sessions:
```ruby ```ruby
# in config/initializers/session_store.rb # in config/initializers/session_store.rb
AppName::Application.config.session_store :cookie_store, :key => 'SOMETHINGNEW' AppName::Application.config.session_store :cookie_store, key: 'SOMETHINGNEW'
``` ```
or or