Rails Best Practice: Add Javascripts manually or use gem?
assets, javascript, ruby, ruby-on-rails
Solution
If the gem does not provide any helpers or generators, then it's typically just a convenience that allows you to easily update the version of the assets via the Gemfile. This is nice, as long as the gem itself is relatively close in version to the actual source.
I usually start with the gem, make sure it's being updated regularly, and then move to the source if I really need to.
I've also recently started using bower for some JS sources, and there is a complementary bower-rails gem that provides some bundler like capabilities. Pretty sweet actually!
Problem
I'm pretty new to Rails and I'm not sure what is best practice when it comes to adding assets. Can anybody tell me the advantages and disadvantages of having Javascripts within the assets vs using corresponding gem? I find gems for pretty much all javascript libraries I want to use. For example, IntroJS. Should I go with the gem or download the javascript and have the library in my assets?