This is causing me a lot of frustration. I'm hoping someone can help me out.
In my application.js file I have the following:
//= require jquery //= require jquery_ujs //= require jquery.remotipart //= require jquery-ui //= require jquery.purr //= require jquery.slides //= require best_in_place //= require twitter/bootstrap //= require_tree .
Just wondering what the best practice is for js files in asset pipeline and getting them to work together as one.
So instead of:
//= require_tree .
//= require posts //= require comments
Furthermore, when you are using coffeescript as I assume you do, you have to use a namespace in order for variables to be avaible throughout your application.
So for example.
$ -> window.my_super_variable = 'super' window.my_super_function = (message) -> alert(message)
$ -> my_super_variable += ' awesome' my_super_function(my_super_variable)
If you don't use window when defining variables or functions they won't be accessible globally.