Skip to content

Instantly share code, notes, and snippets.

@weshouman
Last active August 6, 2016 14:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save weshouman/60121eb88dcec43af2bc7eea905f2bc0 to your computer and use it in GitHub Desktop.
Save weshouman/60121eb88dcec43af2bc7eea905f2bc0 to your computer and use it in GitHub Desktop.
Front end development notes

Install Bower

Install bower on the system (required by bower-rails gem)

npm install -g bower

Add Bower to the Gemfile

gem 'bower-rails'

Install the gem

bundle install

Add The FrontEnd Packages

In Bowerfile add the packages to be installed.

asset: 'angular'
asset 'angular-ui-router'
# vim: ft=ruby

Packages could be found here
Or searched for by

bower search <query>

For more check this documentation

When done install the packages using

rake bower:install

We'll need to require the js files in application.js to be accessible through the application.
in application.js add

//= require angular/angular
//= require angular-ui-router

Consume The New Packages

Now we can use the installed packages (angular and angular-ui-router) in the javascript/coffeescript files in our assets And consume them directly in our html files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment