diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-07-09 02:40:57 -0700 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-07-09 02:40:57 -0700 |
commit | 76e95c0ce82f436d4e1f0f1a3251242dd9d18d36 (patch) | |
tree | 750240787931889a3c5f469ce9abc0712af2c4bf /guides/source | |
parent | 90d1a3f723ac6133099127cd888aba8eafbeed08 (diff) | |
parent | a08cc479389a44aa34529bfa5bdce6baee2fc7c1 (diff) | |
download | rails-76e95c0ce82f436d4e1f0f1a3251242dd9d18d36.tar.gz rails-76e95c0ce82f436d4e1f0f1a3251242dd9d18d36.tar.bz2 rails-76e95c0ce82f436d4e1f0f1a3251242dd9d18d36.zip |
Merge pull request #11143 from robin850/upgrading-rails
Add few information about missing steps [ci skip]
Diffstat (limited to 'guides/source')
-rw-r--r-- | guides/source/upgrading_ruby_on_rails.md | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/guides/source/upgrading_ruby_on_rails.md b/guides/source/upgrading_ruby_on_rails.md index 0f388d15c4..5992e94cd8 100644 --- a/guides/source/upgrading_ruby_on_rails.md +++ b/guides/source/upgrading_ruby_on_rails.md @@ -131,7 +131,15 @@ The following changes are meant for upgrading your application to Rails 4.0. ### Gemfile -Rails 4.0 removed the `assets` group from Gemfile. You'd need to remove that line from your Gemfile when upgrading. +Rails 4.0 removed the `assets` group from Gemfile. You'd need to remove that +line from your Gemfile when upgrading. You should also update your application +file (in `config/application.rb`): + +```ruby +# Require the gems listed in Gemfile, including any gems +# you've limited to :test, :development, or :production. +Bundler.require(:default, Rails.env) +``` ### vendor/plugins @@ -149,6 +157,9 @@ Rails 4.0 no longer supports loading plugins from `vendor/plugins`. You must rep * Rails 4.0 has removed `attr_accessible` and `attr_protected` feature in favor of Strong Parameters. You can use the [Protected Attributes gem](https://github.com/rails/protected_attributes) to a smoothly upgrade path. +* If you are not using Protected Attributes, you can remove any options related to +this gem such as `whitelist_attributes` or `mass_assignment_sanitizer` options. + * Rails 4.0 requires that scopes use a callable object such as a Proc or lambda: ```ruby @@ -208,6 +219,11 @@ Please read [Pull Request #9978](https://github.com/rails/rails/pull/9978) for d * Rails 4.0 deprecates the `dom_id` and `dom_class` methods in controllers (they are fine in views). You will need to include the `ActionView::RecordIdentifier` module in controllers requiring this feature. +* Rails 4.0 deprecates the `:confirm` option for the `link_to` helper. You should +instead rely on a data attribute (e.g. `data: { confirm: 'Are you sure?' }`). +This deprecation also concerns the helpers based on this one (such as `link_to_if` +or `link_to_unless`). + * Rails 4.0 changed how `assert_generates`, `assert_recognizes`, and `assert_routing` work. Now all these assertions raise `Assertion` instead of `ActionController::RoutingError`. * Rails 4.0 raises an `ArgumentError` if clashing named routes are defined. This can be triggered by explicitly defined named routes or by the `resources` method. Here are two examples that clash with routes named `example_path`: @@ -295,6 +311,12 @@ Active Record Observer and Action Controller Sweeper have been extracted to the ### sprockets-rails * `assets:precompile:primary` has been removed. Use `assets:precompile` instead. +* The `config.assets.compress` option should be changed to +`config.assets.js_compressor` like so for instance: + +```ruby +config.assets.js_compressor = :uglifier +``` ### sass-rails |