Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5849739
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T13:02:35+00:00 2026-05-22T13:02:35+00:00

I have a Tour model with a paperclip ‘cover’ attachment. When the Tour model

  • 0

I have a Tour model with a paperclip ‘cover’ attachment. When the Tour model is created it will happily upload the file I’ve selected. It all looks something like this:

<% form_for [@user, @tour], :html => {:multipart => true} do |form| %>
 <%= form.text_field :title %>
 <%= form.file_field :cover %>
 <%= form.text_field :pic_url %>
 <%= form.submit 'go' %>
<% end %>

I’ve recently re-implemented the edit action of Tour so the form is posted remotely. I’ve got the remote form working well posting and updating my form via ajax however when I wish to change the ‘cover’ image it doesn’t change. The remote form looks something like this:

<%= form_for [@user, @tour], :remote => true, :update => "tour_form_holder", :html => {:multipart => true} do |form| %> 
 <%= form.text_field :title %>
 <%= form.file_field :cover %>
 <%= form.text_field :pic_url %>
 <%= form.submit 'go' %>
<% end %>

Looking at the data posted by the form it doesn’t seem as though it’s posting anything to do with ‘cover’ – unlike when I posted the form without ajax.

The one thing that does work however, is posting a url to a file using the form. I’ve set up ‘pic_url’ to be an alternative to uploading a local file. I know this isn’t interfering because I’ve removed it and tried without it.

I know that Amazon s3 and paperclip are working – it’s just something about this remote form that isn’t… any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T13:02:35+00:00Added an answer on May 22, 2026 at 1:02 pm

    It is not possible to upload a file via an AJAX request. See here for more details: uploading a file via ajax with php

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this XML file, <tour title=Bavaria, Austrian, and the Alps baseCost=1799.99> <availability start=2011/03/25
I have built a simple tour on my website that will be coded using
I have a model like this: class Tour(models.Model): Name=models.CharField(max_length=100) Count=models.SmallIntegerField() ActionDate=models.DateTimeField(editable=False) ActionUser=models.ForeignKey(User,editable=False) StatusType=models.ForeignKey(StatusType) now
I have this form: class TourForm(ModelForm): class Meta: model = Tour I wanna design
I have a database that which contains two tables, links and tour. Tour is
Flash CS4, AS2 I am making a Flash tour. I have 3 sections: About,
I have one problem with Django Framework. I changed one model insert this: masterweb_link
I have a NSManagedObject subclass named Tour. I stored the reference to it using
I have a model Client which has many :tours, association in it. I am
I have a model Post : class Post < ActiveRecord::Base has_one :draft, class_name: Post,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.