Skip to content
This repository
Browse code

Turn turbolinks on by default for new apps

  • Loading branch information...
commit e35d8b18d0649c0ecc58f6b73df6b3c8d0c6bb74 1 parent b0a7068
David Heinemeier Hansson authored October 04, 2012
9  railties/lib/rails/generators/app_base.rb
@@ -226,7 +226,14 @@ def assets_gemfile_entry
226 226
       end
227 227
 
228 228
       def javascript_gemfile_entry
229  
-        "gem '#{options[:javascript]}-rails'" unless options[:skip_javascript]
  229
+        unless options[:skip_javascript]
  230
+          <<-GEMFILE
  231
+            gem '#{options[:javascript]}-rails'
  232
+            
  233
+            # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
  234
+            gem 'turbolinks'
  235
+          GEMFILE
  236
+        end
230 237
       end
231 238
 
232 239
       def javascript_runtime_gemfile_entry
5  railties/lib/rails/generators/rails/app/templates/Gemfile
@@ -9,14 +9,13 @@ source 'https://rubygems.org'
9 9
 <%= assets_gemfile_entry %>
10 10
 <%= javascript_gemfile_entry %>
11 11
 
12  
-# Puts a simple HTTP cache in front of your app.
13  
-# For large-scale production use, consider using a caching reverse proxy like nginx, varnish, or squid.
  12
+# Puts a simple HTTP cache in front of your app (and gets you ready for later upgrading to nginx/varnish/squid)
14 13
 gem 'rack-cache', '~> 1.2'
15 14
 
16 15
 # To use ActiveModel has_secure_password
17 16
 # gem 'bcrypt-ruby', '~> 3.0.0'
18 17
 
19  
-# To use Jbuilder templates for JSON
  18
+# Build JSON APIs with ease. Read more: http://github.com/rails/jbuilder
20 19
 # gem 'jbuilder'
21 20
 
22 21
 # Use unicorn as the app server
1  railties/lib/rails/generators/rails/app/templates/app/assets/javascripts/application.js.tt
@@ -13,5 +13,6 @@
13 13
 <% unless options[:skip_javascript] -%>
14 14
 //= require <%= options[:javascript] %>
15 15
 //= require <%= options[:javascript] %>_ujs
  16
+//= require turbolinks
16 17
 <% end -%>
17 18
 //= require_tree .

0 notes on commit e35d8b1

Please sign in to comment.
Something went wrong with that request. Please try again.