Skip to content

Instantly share code, notes, and snippets.

@JessCodes
Last active April 2, 2018 01:33
Show Gist options
  • Save JessCodes/ced52718f2ee977ed3d12a83cba1e868 to your computer and use it in GitHub Desktop.
Save JessCodes/ced52718f2ee977ed3d12a83cba1e868 to your computer and use it in GitHub Desktop.
Rails, Bower, Materialize, Heroku in 10 Steps!

Rails, Bower, Materialize, Heroku

  1. To install Bower, you need to have to have node, npm, and git installed. Then run npm install -g bower
  2. Create a bower.json file and add:
{
  "name": "personal-website",
  "dependencies": {
    "jquery": "latest",
    "materialize": "latest",
    "d3": "latest",
    "underscore": "latest"
  }
}
  1. In .bowerrc:
{
"directory": "vendor/assets/components"
} 
  1. Run bower install
  2. In the class application of config/application.rb:
config.assets.paths << Rails.root.join('vendor', 'assets', 'components') 
  1. In Gemfile include: gem 'materialize-sass'
  2. In app/assets/javascripts/application.js (add dependencies to your asset manifest files):
//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require_tree .
//= require materialize
//
// Bower packages
//= require d3
//= require underscore
//
  1. In app/assets/stylesheets/application.css (add dependencies to your asset manifest files):
*= require materialize
  1. In a .gitignore, include:
/vendor/assets/components/*
  1. Deploy to Heroku!
heroku create <app-name>
git push heroku master (or 'git push heroku <branch-name>-master)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment