diff options
author | Lauro Caetano <laurocaetano1@gmail.com> | 2013-11-21 22:11:26 -0200 |
---|---|---|
committer | Lauro Caetano <laurocaetano1@gmail.com> | 2013-11-21 23:31:57 -0200 |
commit | c09ef94a494eb8d0f690a84bc82b2bddcfe13e1b (patch) | |
tree | 5639c905e606d01a85f6829b24ef7df1f2c9d05e /railties/lib | |
parent | 47229208fccb7fbb284935738beb74ad102d29ee (diff) | |
download | rails-c09ef94a494eb8d0f690a84bc82b2bddcfe13e1b.tar.gz rails-c09ef94a494eb8d0f690a84bc82b2bddcfe13e1b.tar.bz2 rails-c09ef94a494eb8d0f690a84bc82b2bddcfe13e1b.zip |
Remove turbolinks when generating a new application based on a template
that skips it.
It can be skipped adding `add_gem_entry_filter { |gem| gem.name != "turbolinks" }` to the template.
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/rails/generators/app_base.rb | 2 | ||||
-rw-r--r-- | railties/lib/rails/generators/rails/app/templates/app/assets/javascripts/application.js.tt | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb index d79cf2b2f0..2022b4ed3d 100644 --- a/railties/lib/rails/generators/app_base.rb +++ b/railties/lib/rails/generators/app_base.rb @@ -113,7 +113,7 @@ module Rails end def add_gem_entry_filter - @gem_filter = lambda { |next_filter,entry| + @gem_filter = lambda { |next_filter, entry| yield(entry) && next_filter.call(entry) }.curry[@gem_filter] end diff --git a/railties/lib/rails/generators/rails/app/templates/app/assets/javascripts/application.js.tt b/railties/lib/rails/generators/rails/app/templates/app/assets/javascripts/application.js.tt index 8b91313e51..07ea09cdbd 100644 --- a/railties/lib/rails/generators/rails/app/templates/app/assets/javascripts/application.js.tt +++ b/railties/lib/rails/generators/rails/app/templates/app/assets/javascripts/application.js.tt @@ -13,6 +13,8 @@ <% unless options[:skip_javascript] -%> //= require <%= options[:javascript] %> //= require <%= options[:javascript] %>_ujs +<% if gemfile_entries.any? { |m| m.name == "turbolinks" } -%> //= require turbolinks <% end -%> +<% end -%> //= require_tree . |