Project Ramon

A learning journey from a Ruby noob perspective

Pick of the Week: bower-rails

pow_12-13-13_header_img

Todays pick of the week comes from one of my AirPair mentors, Gleb Mazovetskiy.  Bower is a front-end package management system brought to us by the kind people at Twitter.

Due to the ever approaching holidays, I haven’t had the time to implement this in my project as of yet. But I’ve added it to my weekend to-do list, and decided to select it as my pick for this week.

Bower has over 6,500 components available in their library, everything from twitter bootstrap to Animate.css and JQuery mobile to Angular.js and Backbone.js.

pow_12-13-13_img1

There is a rails gem for bower named bower-rails, which has dependencies of Node and Bower (> =0.10.0) installed via npm.

There are quite a few helpful resources to get Bower up and running in our application. One way to manage dependencies with Bower in our Rails application is to use a version of Sprockets which allows our manifest files (remember application.js and application.css from yesterday?) to require packages definde by Bower. The first answer to a StackOverflow question about this topic mentions that the bower defined packages feature was added in Sprockets 2.6, which Rails 3.x won’t allow us to bundle due to a version restriction. So we can get this feature working in our Rails 3.x apps by adding gem 'sprockets', '2.2.2.backport1' to our Gemfile and then typing bundle exec install in our terminal. This StackOverlow answer goes on to say that our bundling this sprockets backport into our dependencies will make Sprokets to start looking for our assets in vendor/assets/components.

I hope you all have a great weekend.

Stay tuned…

Advertisements

Categories: Ruby on rails

Tags: ,

2 replies

Trackbacks

  1. Sevendaysports Lessons Learned | Project Ramon
  2. AirPair.com – What I’ve Learned pt. 2 | Project Ramon

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s