Screencast Asset Pipeline Patterns Ruby

  • Carlos Souza
  • 5100 views
Badge student

Locked Content

A subscription is required for viewing this video. Enroll now to get full access to all Code School courses and content.

Enroll Now Sign in

Comments

  1. Eric Allam said

    Since it's a little hard to see, here is a gist of the application.css and application.js manifest files:

    https://gist.github.com/2570293

  2. Julian said

    Great man, you've saved my ass.

  3. Faculty

    Carlos Souza said

    Glad to know, Julian lol

  4. Deyvid Nascimento said

    Thank's caike! (Vlw cara)

  5. Fabricio Matías Quagliariello said

    Hey Caike, great tips. You answered my asset pipeline related prayers. :-)

    Cheers!

  6. 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.

  7. Faculty

    Carlos Souza said

    You can check for the current controller and include your javascripts accordingly. Here is an example https://gist.github.com/2954563

  8. Nola Stowe said

    Thank you!

  9. 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 ;)

  10. Faculty

    Carlos Souza said

    haha obrigado, Celso!

  11. 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!

  12. 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?

  13. 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.

  14. will barker said

    Cool! thanks. brew install tree it is : )

  15. 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?

  16. 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.

About This Screencast

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.

You need to be an enrolled student in order to view this video and subscribe.

Enroll Now