2

I want to install plugin for ajax upload in Rails 3.1.

How to do that? Just execute git clone in vendor/?

What about asset pipeline? I must specify some code like that in application.js?

//= require vendor/file-upload

Do you know better plugin for ajax file upload, than this one?

https://github.com/valums/file-uploader

UPDATE

I want to upload file without clicking submit, so remotipart doesnt apply to that.

1 Answer 1

2

Instead of installing plugins under ./vendor (that's the old Rails way), you should look for a GEM which does the functionality, and add the Gem to the Gemfile, then run bundle install.

e.g. add this to your ./Gemfile :

gem 'name_of_the_gem' , "version_number"  # the version_number is optional

then run bundle install

There are a couple of gems available for file-uploading, some of them support AJAX. e.g.:


Plugin Installation on Rails 3:

$ rails plugin install http://wherever.com/somewhere/plugin_name.git

or

cd vendor/plugins

git clone -q http://wherever.com/somewhere/plugin_name.git

or

git submodule add http://wherever.com/somewhere/plugin_name.git vendor/plugins/plugin_name
Sign up to request clarification or add additional context in comments.

2 Comments

Ok. This will probably work fine. But what about if I want to install the jquery plugin directly without adding a gem? Can you provide a solution to that problem? You could leave it for others..
I want to upload file without clicking submit button, so remotipart tutorials dont apply to that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.