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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T04:51:43+00:00 2026-06-08T04:51:43+00:00

I have a lightbox in which I want to render a Rails partial, like

  • 0

I have a lightbox in which I want to render a Rails partial, like so:

var data = "render :conversations => new";
$('#lightbox').append('#{escape_javascript(data)');

Unfortunately, this results in the text “render :conversations => new” appearing in the lightbox, rather than the actual rendering. I assume this is because I’m appending the partial rather than rendering it at runtime. I’ve followed the advice on this thread, but to little success. It recommends I add a “!=” in front of the append line like so:

!= "$('#lightbox').append('#{escape_javascript(data)');"

This throws a syntax error because of the “!=”. Perhaps I’m using this symbol incorrectly, but I can’t find any information about it on Google. How might I get this to work?

  • 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-08T04:51:46+00:00Added an answer on June 8, 2026 at 4:51 am

    I think you want to do:

    $('#lightbox').append('#{escape_javascript(render :conversations => new)');
    

    But I don’t really understand how your code could result in appending the text “render :conversations => new”. var data = "render :conversations => new"; looks like JavaScript and escape_javascript(data) is server side ruby so it could not know about data. I notice also that the the #{ has no ending }. Is this really the exact code you tested?

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

Sidebar

Related Questions

I have a lightbox-like div which appears over pages to present scrollable content. In
Issue I'm planning on making a lightbox-like project page. I want to have it
All lightbox scripts have the image gallery option which are built like this: <a
The problem: I have a UserControl (LightBox) which overlays a number of other controls
I have a lightbox at my website. It is a shadowbox script which opens
Is there a way to have lightbox on page load?? Say like when the
Have a procedure which looks like Procedure TestProc(TVar1, TVar2 : variant); Begin TVar1 :=
I have a Lightbox clone (colorbox), which works fine and has no real issues.
I have a gallery which uses Fancybox to load an iFrame inside the lightbox
I have a normal textbox, and a lightbox with a text input. I want

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.