Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## USAGE: rails new <app name> -m path/to/file.rb
- # Modified Gemfile
- # replaced sqlite3 with postgresql
- # if you still want to use sqlite3 comment out the next couple lines
- gsub_file 'Gemfile', "# Use sqlite3", "# Use postgresql"
- gsub_file 'Gemfile', "gem 'sqlite3'", "gem 'pg'"
- # sass-rails is outdated, replaced with sassc-rails gem
- gsub_file 'Gemfile', "gem 'sass-rails', '~> 5.0'", "gem 'sassc-rails'"
- # inserted gems required for bootstrap
- insert_into_file 'Gemfile',
- "\n\n# gems required for bootstrap
- gem 'sprockets-rails'
- gem 'bootstrap'
- gem 'jquery-rails'",
- after: "gem 'bootsnap', '>= 1.1.0', require: false"
- # Renamed application.css to application.scss
- copy_file 'app/assets/stylesheets/application.css', 'app/assets/stylesheets/application.scss'
- remove_file 'app/assets/stylesheets/application.css'
- # Modified application.scss for bootstrap
- gsub_file 'app/assets/stylesheets/application.scss', '= require_tree .', ''
- gsub_file 'app/assets/stylesheets/application.scss', '= require_self', ''
- append_to_file 'app/assets/stylesheets/application.scss', "@import 'bootstrap';"
- # Modified application.js file for bootstrap
- insert_into_file 'app/assets/javascripts/application.js',
- "\n//= require jquery3\n//= require popper\n//= require bootstrap-sprockets",
- after: '//= require rails-ujs'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement