A subscription is required to view this video. Enroll Today

Ruby

Asset Pipeline Patterns

  • Caike
  • 2464 views

The Rails Asset Pipeline is a powerful tool for managing an application's assets but it can be difficult to use at first. In this screencast we'll look at the basic concept behind the pipeline, how to organize manifest files, use sass-rails helpers and debug production assets locally.

Comments

Chris Hough said

Thanks Caike! I have a few questions, would it make more sense to include the application js/css for global css and the locals where applicable for overrides or specific view requirements? also, you change those asset settings by mode so they only have to be setup one time depending on where you are deploying your code?

Faculty

Carlos Souza said

The 'tree' command is a unix command line program. If you are on a linux box, you can install it via package manager (i.e., apt-get) or you can install it via homebrew if you are on a Mac.

will barker said

During the screen cast, The tree command is used to get the folder structure. How is this happening? this isn't available in regular bash right?

42 Dev Team said

This really helped me understand some more about the asset pipeline (kind of a mystery til now). I also never knew about sass-rails helpers which are awesome!

Celso de Sá said

Vou escrever em português por que sei que você é brasileiro: muito bom! Continuem com o excelente trabalho, tenho aprendido um bocado aqui na codeschool ;)

bertomart said

Thanks for the cast. One question. What happens if you're using the same layout for say the user's controller and the main page and you want to include only the application.js for the main page, but you want to add user.js for the user's page, but not admin.js (from an admin page for example). Thank you.

Download

Share