Search code examples
ruby-on-rails-3asset-pipelineujs

rails 3.1 upgrade with backbone, can't find ujs and remotipart files


I upgraded to rails 3.1.3 a few weeks ago, and moved a bunch of stuff around to use backbone.

Mostly, things are going well, but I just realized that the rails-ujs.js file and remotipart.js files are not in the assets directory.

I've looked for them in the old public/javascripts folder, as well as everywhere else, but no luck finding them.

I also can't seem to find the files in the git repos. Is there somewhere to download these files in Javascript? or do they need to be generated by rails? Is there a way to regenerate them?

---------------this could be my error ----------------------------

I just realized that with the assets packed, you can't just open a file from view source, they all show as non-existent.


Solution

  • I think theses files lived in the rails ujs plugins in asset directory. so you need to add it to your Gemfile and the asset pipeline should see them automaticaly.

    all files here https://github.com/rails/jquery-ujs/tree/master/src are available to include in your js file with

    //= require jquery
    //= require jquery_ujs
    

    see plugin readme for more informations