Skip to content

Commit e35d8b1

Browse files
author
David Heinemeier Hansson
committed
Turn turbolinks on by default for new apps
1 parent b0a7068 commit e35d8b1

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

railties/lib/rails/generators/app_base.rb

+8-1
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,14 @@ def assets_gemfile_entry
226226
end
227227

228228
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
230237
end
231238

232239
def javascript_runtime_gemfile_entry

railties/lib/rails/generators/rails/app/templates/Gemfile

+2-3
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,13 @@ source 'https://rubygems.org'
99
<%= assets_gemfile_entry %>
1010
<%= javascript_gemfile_entry %>
1111
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)
1413
gem 'rack-cache', '~> 1.2'
1514
1615
# To use ActiveModel has_secure_password
1716
# gem 'bcrypt-ruby', '~> 3.0.0'
1817
19-
# To use Jbuilder templates for JSON
18+
# Build JSON APIs with ease. Read more: http://github.com/rails/jbuilder
2019
# gem 'jbuilder'
2120
2221
# Use unicorn as the app server

railties/lib/rails/generators/rails/app/templates/app/assets/javascripts/application.js.tt

+1
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@
1313
<% unless options[:skip_javascript] -%>
1414
//= require <%= options[:javascript] %>
1515
//= require <%= options[:javascript] %>_ujs
16+
//= require turbolinks
1617
<% end -%>
1718
//= require_tree .

0 commit comments

Comments
 (0)