Manage Assets With Rails Assets Discussion
Love rails assets. I first found out about it about a year ago, and it quickly became one of my favorite ways to grab front end libs. :)
I have many app using asset as regular mode and this the first time hear about rails asset. Thanks for that. I'm going definitely change to this
Great Stuff Chris... This is definitely a better way to add frontend libs. One more tool for the toolchain....
So awesome! I was using bower-rails and was not aware of this option. Thanks so much for sharing Chris!
That's awesome, Thank you Chris I never thought a such thing exists... But does this work for all libraries ? after watching the video I tried rails-assets-ckeditor but it seems that I am getting errors like ActionController::RoutingError (No route matches [GET] "/lang/en.js"): ........
It should, but with more complex things like ckeditor, you might have to have those lang/en.js files compiled separately. Something like this based upon the filename in the Rails Assets gem.
config.assets.precompile += %w( lang/en.js )
This is definitely one part where the documentation with Rails Assets is poor.
Hi I am trying Rails Assets but I approach to a problem. I included Bourbon but when I tried use any mixin Rails told me that mixin is undefined. What to do?
Thanks for sharing a screencast on this Chris. Recently we used the same thing in one of our client projects. As a first timer to it back then, I found it a little difficult to figure out where could I find runtime dependencies to the gems I'd like to use from the Rails Assets site. I've written a blog( http://www.cybrilla.com/blo... ) on how one could find runtime dependencies for the gems they'd like to use via Rails assets.
Great video. I experimented by switching out my bootstrap-sass gem. The one thing I'm not understanding, is how do you tell rails-assets the version constraints you would like to stay within like the convention with rubygems? Thx!
I believe it works by just setting the version on the gem you include.
gem "rails-assets-bootstrap", "1.0.0"
Thanks for the quick response Chris. I'm assuming that if an explicit version is not specified, rails-assets will take the latest available version then... correct? Love the videos!
You are correct. It'll use that latest version of the library. And thanks! :D
Hey Chris - how are custom styles handled? Do we simply place them into the application.css file? Or are we required to build a separate customization file?
If you're trying to customize something like bootstrap, you can do this: Instead of doing the
*= require bootstrap, you can do
@import "bootstrap" to import the file using SASS and put your custom variables above the import to override the defaults.
Basically it doesn't change from how you would normally do it, but it can be a little unclear since they don't give you any instructions. Does that make sense though?
I often had kind of feeling that using bower and rubygems for such simple task as fetching vendor assets is too much overhead. So I wrote https://github.com/torba-rb.... Please, check it out.
Awesome Awesomer Awesomesttttt! I was using bower-rails and was not aware of this option. Thanks so much for sharing Chris!