Where to place js files in Rails 3.2

I want to use jquery-File-upload in Rails 3.2, but I'm a newbie and don't know where to put the necessary js files. The documentation says there are dirs

  • app / assets: app-specific assets
  • lib / assets: library assets written by your development team
  • supplier / assets: third party assets

I know such questions. But I want to know this plugin for downloading files.

thank

+3
source share
4 answers

If JS is specifically for this application, I would put them in app/assets

I tend to have someone else encoded into vendor/assetsand any reusable content that I encoded into lib/assets.. These are things like sliders and what not.

+1

jquery-file-upload rails 3.2. app/assets/javascript/vendor.

//= require vendor/jquery-file-upload

application.js

.

0

Typically, gems / plugins are used to handle file uploads. My favorite, and perhaps the most ubiquitous Paperclip.

0
source

Check this app, Upload jQuery file upload files and clips

No need to download files, just add

gem 'jquery-fileupload-rails'

in the gemfile and copy the code shown in

app/views/uploads/index.html.erb

applying any necessary changes to the model name

0
source

All Articles