Asset Pipeline Patterns

  • Caike
  • 3826 views
Hall-pass

Oops, a subscription is required to view this video. You can enroll now to watch, or try out all that Code School has to offer with a free two-day Hall Pass.

Comments

Faculty

Carlos Souza said

Whoa.. sorry for the super late reply. Yes, Chris. Using an application js/css for global stuff and then using specific ones where applicable is a strategy that I use a lot.

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?

will barker said

Cool! thanks. brew install tree it is : )

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!

Faculty

Carlos Souza said

haha obrigado, Celso!

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.

Faculty

Carlos Souza said

Glad to know, Julian lol

Julian said

Great man, you've saved my ass.

About

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.

Subscribe