Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. ## USAGE: rails new <app name> -m path/to/file.rb
  2.  
  3. # Modified Gemfile
  4. # replaced sqlite3 with postgresql
  5. # if you still want to use sqlite3 comment out the next couple lines
  6. gsub_file 'Gemfile', "# Use sqlite3", "# Use postgresql"
  7. gsub_file 'Gemfile', "gem 'sqlite3'", "gem 'pg'"
  8.  
  9. # sass-rails is outdated, replaced with sassc-rails gem
  10. gsub_file 'Gemfile', "gem 'sass-rails', '~> 5.0'", "gem 'sassc-rails'"
  11.  
  12. # inserted gems required for bootstrap
  13. insert_into_file 'Gemfile',
  14. "\n\n# gems required for bootstrap
  15. gem 'sprockets-rails'
  16. gem 'bootstrap'
  17. gem 'jquery-rails'",
  18. after: "gem 'bootsnap', '>= 1.1.0', require: false"
  19.  
  20. # Renamed application.css to application.scss
  21. copy_file 'app/assets/stylesheets/application.css', 'app/assets/stylesheets/application.scss'
  22. remove_file 'app/assets/stylesheets/application.css'
  23.  
  24. # Modified application.scss for bootstrap
  25. gsub_file 'app/assets/stylesheets/application.scss', '= require_tree .', ''
  26. gsub_file 'app/assets/stylesheets/application.scss', '= require_self', ''
  27. append_to_file 'app/assets/stylesheets/application.scss', "@import 'bootstrap';"
  28.  
  29. # Modified application.js file for bootstrap
  30. insert_into_file 'app/assets/javascripts/application.js',
  31. "\n//= require jquery3\n//= require popper\n//= require bootstrap-sprockets",
  32. after: '//= require rails-ujs'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement