RubyFlow : The Ruby Community Blog

Home   Submit   Sign Up   Log In   leaders   Twitter   RSS Feed  

Finally, A Sexy Way To Organize JS Files Using Rails Asset Pipeline

It is great that Rails asset pipeline compress all our js files into one big js file. But sometimes it introduces code conflicts and shits because what we really want is specific js code per page!

Check out Paloma and start organizing your JS files the sexy way. :)


Any reason for the generator having unusual syntax?

rails g paloma:add users/new

Why not use the rails controller generator syntax for this?

rails g paloma users new

Othen than that, nice gem. I can myself using it some day.AlexanderZaytsev - December 26, 2012 08:35

I really like the parameter passing part - all the existing methods of passing server side values to your JavaScript never seemed that clean to me. Being able to declare it in the controller like that is great.

One comment - calling it a "js_callback" in the controller doesn't sit right - it's not exactly what I think of when I think callback. It's just the client side part of your action...maybe call it just "js" or even "javascript"?

We use BackboneJS and have a couple lines of JavaScript code in each view to set up the right backbone view - something like this can clean it up nicely.galori - December 29, 2012 05:31

Post a Comment

Comment abilities for non registered users are currently deactivated, pending time to add a proper CAPTCHA to solve the escalating spam problem. Sorry!