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

  • SEARCH
  • Home
  • 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 9276899
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T16:57:51+00:00 2026-06-18T16:57:51+00:00

I have a Backbone.js on Rails application, and I wanted to upload an image

  • 0

I have a Backbone.js on Rails application, and I wanted to upload an image with AJAX. What’s weird is that the image is uploading to my Amazon S3, but ajax is throwing a parse error.

= form_for @page, :html => { :multipart => true, :data => { :type => 'json' } }, :remote => true do |f|

  .field
    = f.label :bg_image
    = f.file_field :bg_image

  .actions
    = f.submit 'Save'

When I click save, it uploads fine (which I know because when I refresh it shows the new image, and there isn’t an error in my rails console). However, I want to bind the new image to my backbone model, but the following just results with a parseerror in JS console.

  $("form").bind "ajax:success", (event, data) ->
    log data

  $("form").bind "ajax:error", (jqXHR, textStatus, errorThrown) ->
    log jqXHR
    log textStatus
    log errorThrown
  • 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-06-18T16:57:53+00:00Added an answer on June 18, 2026 at 4:57 pm

    Turns out I needed :format => :json in my form, in order to make the action url json (this is in addition to the ‘data-type’ => ‘json’).

    It was redirecting, because the html response is a redirect, hence the parseerror.

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

Sidebar

Related Questions

I have a Rails application with the backbone-rails gem. Which works out fine but
I have a Backbone.js application that allows users to create graphs based on large
I have an application created with PhoneGap and Backbone. I upload a file as
I'm working on a backbone rails application that needs to poll the server to
I have rails model article receive_letters:boolean. And I have backbone in my application. In
I have small rails application with mysql2 database (2 tables), backbone and bootstrap. I
I have a rails app using backbone, but when I call save, the server
I have an application in rails 3 using backbone.js When I use @model.save, i
I have a backbone/rails app that uses local storage and jquery ui. I developed
I have a rails-backbone project that generates jst.ejs templates. I'd like to include some

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.