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 7694971
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T21:26:23+00:00 2026-05-31T21:26:23+00:00

So, I ran into a really interesting issue when playing around with uploading files

  • 0

So, I ran into a really interesting issue when playing around with uploading files remotely with Remotipart. I’ve tried the following two versions in my update.js.erb view, which the server sends after a successful file upload:

<%= remotipart_response do %>
    $("#container").html('<p>Success!</p><%= link_to('Back', gallery_items_path, :remote => true) %>');
<% end %>

and

<%= remotipart_response do %>
    $("#container").html("<p>Success!</p><%= link_to('Back', gallery_items_path, :remote => true) %>");
<% end %>

Version one successfully changes the markup in #container, and version two fails without any error, server- or client-side. I thought single vs double quotes is only an issue when JSON is in play, but it seems I was wrong. I also noticed the Remotipart example uses single quotes exclusively, and I’m not sure if this is on purpose or not.

I’m using Rails 3.2.1, Remotipart 1.0.2, and (not sure if this matters) Chrome 17.

Does anyone know what causes this?

EDIT:
In answer to Alex’s question:

In the first case, the output rendered is, as expected:

<div id="container">
    <p>Success!</p>
    <a href="/gallery_items" data-remote="true">Back</a>
</div>

In the second case, like I said, there was no change in the contents of <div id="container">.

  • 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-31T21:26:25+00:00Added an answer on May 31, 2026 at 9:26 pm

    The actual js passed to the browser in the 2nd case is;

    $("#container").html("<p>Success!</p><a href="/gallery_items" data-remote="true">Back</a>");
    

    The outer string is enclosed in " as its delimiter but as the contents also contain " it breaks. (x = "aa"bb" is invalid).

    The former example uses the ' delimiter so there is no problem.

    To use " you must escape link_to‘s return to produce

    $("#container").html("<p>Success!</p><a href=\"/gallery_items\" data-remote=\"true\">Back</a>");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I ran into an interesting (and very frustrating) issue with the equals() method today
I have ran into a really annoying issue which gives me this error: The
I'm developing an iPad app and I ran into a really weird issue here.
(this is regarding the Ramaze.net framework) I ran into some really strange problems while
Ran into something interesting, want to know if I'm doing something wrong or if
I ran into an issue with an IIS web app shutting down an idle
I ran into an interesting behavior recently. It seems that if I override .equals()
I ran into an interesting (?) problem in the YUI rich edit demo on
I ran into a little problem today when I was creating a really quick
I ran into an issue while compiling an openGl code. The thing is that

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.