読者です 読者をやめる 読者になる 読者になる

Thanks Driven Life

日々是感謝

rails new の --javascript= に指定できるもの

rails

環境

Ruby on Rails 4.1.1

結論

なんでも指定できる

参照

Rails 4.1.1 railties/lib/rails/generators/app_base.rb#L288-L289

実践

$ rails new foo --skip-bundle
$ rails new bar --javascript=angularjs --skip-bundle
$ diff -wu -r foo bar

diff をとってみる。(module name とか secret_key_base の部分は省略しています)

diff -wu -r foo/Gemfile bar/Gemfile
--- foo/Gemfile   2014-05-14 08:22:02.000000000 +0900
+++ bar/Gemfile   2014-05-14 08:22:12.000000000 +0900
@@ -14,8 +14,8 @@
 # See https://github.com/sstephenson/execjs#readme for more supported runtimes
 # gem 'therubyracer',  platforms: :ruby
 
-# Use jquery as the JavaScript library
-gem 'jquery-rails'
+# Use angularjs as the JavaScript library
+gem 'angularjs-rails'
 # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
 gem 'turbolinks'
 # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
diff -wu -r foo/app/assets/javascripts/application.js bar/app/assets/javascripts/application.js
--- foo/app/assets/javascripts/application.js 2014-05-14 08:22:02.000000000 +0900
+++ bar/app/assets/javascripts/application.js 2014-05-14 08:22:12.000000000 +0900
@@ -10,7 +10,7 @@
 // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
 // about supported directives.
 //
-//= require jquery
-//= require jquery_ujs
+//= require angularjs
+//= require angularjs_ujs
 //= require turbolinks
 //= require_tree 

angularjs_ujis ってやつが残るぐらい。あとはそのまま使える形になる