diff options
author | Kasper Timm Hansen <kaspth@gmail.com> | 2017-04-17 12:24:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-17 12:24:15 +0200 |
commit | 612572746c311b69d617a7f0d6eb6bdbad82780c (patch) | |
tree | 5408f951c50605b22b0697b69d648a329d8fec36 /railties | |
parent | ee8beaa41bbe6ed47d40be45ce37abb3fb1b79be (diff) | |
parent | a4c1282854795d1f0d7696ce1ccbabf94b3d9098 (diff) | |
download | rails-612572746c311b69d617a7f0d6eb6bdbad82780c.tar.gz rails-612572746c311b69d617a7f0d6eb6bdbad82780c.tar.bz2 rails-612572746c311b69d617a7f0d6eb6bdbad82780c.zip |
Merge pull request #28685 from rails/smooth-form-with-upgrading
Smooth form with upgrading
Diffstat (limited to 'railties')
3 files changed, 4 insertions, 4 deletions
diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb index 324843a5f5..f4717bb35b 100644 --- a/railties/lib/rails/generators/rails/app/app_generator.rb +++ b/railties/lib/rails/generators/rails/app/app_generator.rb @@ -403,9 +403,7 @@ module Rails end def delete_new_framework_defaults - # Sprockets owns the only new default for 5.1: if it's disabled, - # we don't want the file. - unless options[:update] && !options[:skip_sprockets] + unless options[:update] remove_file "config/initializers/new_framework_defaults_5_1.rb" end end diff --git a/railties/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_5_1.rb.tt b/railties/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_5_1.rb.tt index 5f5545c4c7..a0c7f44b60 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_5_1.rb.tt +++ b/railties/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_5_1.rb.tt @@ -5,6 +5,9 @@ # Once upgraded flip defaults one by one to migrate to the new default. # # Read the Guide for Upgrading Ruby on Rails for more info on each option. + +# Make `form_with` generate non-remote forms. +Rails.application.config.action_view.form_with_generates_remote_forms = false <%- unless options[:skip_sprockets] -%> # Unknown asset fallback will return the path passed in when the given diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb index 7965bd68d0..d3e131db94 100644 --- a/railties/test/generators/app_generator_test.rb +++ b/railties/test/generators/app_generator_test.rb @@ -410,7 +410,6 @@ class AppGeneratorTest < Rails::Generators::TestCase assert_no_match(/config\.assets\.js_compressor = :uglifier/, content) assert_no_match(/config\.assets\.css_compressor = :sass/, content) end - assert_no_file "config/initializers/new_framework_defaults_5_1.rb" end def test_generator_if_skip_yarn_is_given |