Chapter 17. Managing Assets and Bundles

If you count all your assets you always show a profit.

Wilson Mizner

Our journey through Rails so far has been thorough, if not a little exhausting. Generators that build entire application structures. Validations in one line of code. Object-relational mapping that helps make creating a database schema a breeze. Relationships that make sense.

Is it any wonder that companies like Airbnb, Groupon, GitHub, Basecamp, and many more are using Ruby on Rails to build amazing products? It’s a web developer’s playland, filled with tools to make the process fun and productive.

Much of the joy of building with Rails comes from embracing the limitations it creates. The structure of the framework means you have to figure out how to build your application the way Rails wants you to build it. Unfortunately, for the longest time, JavaScript and CSS were treated as “second-class citizens,” shoehorned into the public folder to fight for themselves. Because the framework dictates how you’ll use it, frontend designers had to live with the status quo.

All of that changed with Rails 3.1. In the final four chapters, we’ll examine how changes to the Rails framework finally brought JavaScript and CSS into the framework (literally) and what that means for the future of frontend development in Rails.

The Junk Drawer

Prior to Rails 3.1, the public directory served as a “junk drawer” where stylesheets, scripts, images, HTML, text, and other files would ...

Get Learning Rails 5 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.