0
votes

I would like to know whether it is possible to remotely submit an upload image form using Rails and the paperclip gem.

Here is an example form

 = semantic_form_for @material.images.build, :url => images_path(@article), :html => {:multipart => true, :class => "image-upload-form form-inline"}, :remote => true do |f|
     = f.input :file
     = f.input :credit
     = f.submit "Upload Image"

Here is the create action:

 def create
    #some code to handle create
    respond_to do |format|
      format.json
      format.js
      format.html {redirect_to @article}
    end
 end

I can get submit to work for html submit, but not yet for remote submission. So, I'm wondering - Is it possible to upload an image remotely in Rails? I use Paperclip, but if it isn't possible for paperclip i'm also interested generally for rails image upload gems.

2

2 Answers

0
votes
0
votes

There is another gem for upload in Rails : carrierwave . I think it is able to do it .