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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T17:57:06+00:00 2026-05-20T17:57:06+00:00

I am using Rails 3 to load a partial (form) into another page with

  • 0

I am using Rails 3 to load a partial (form) into another page with the code below. The problem is that I want to use :remote => true on the form and use ajax upon it (validation) etc.

$("#form_open").bind("ajax:complete", function(et, e){

    $("#form_area").html(e.responseText);
    $("#form_open").html("Add contact information");

});

This does not seem to be possible. Why can’t I use ajax in this situation?

  • 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-20T17:57:07+00:00Added an answer on May 20, 2026 at 5:57 pm

    If I understood the question, I think what you want to do is to have the ajax call to render a partial into some element in the current page right?

    In the current view:

    <%= link_to 'Add Contact Info', add_contact_info_path, :remote => true %>
    

    Obviously you have to get add_contact_info_path to route to an action, that action should render some js.erb. That js.erb should output some javascript that updates the #form_area and #form_open. So you could have an add_contact_info.js.erb (in jQuery):

    $('#form_area').html("<%= escape_javascript(render('somepartial')) %>");
    $('#form_open').html("Add contact information");
    

    That will render the “_somepartial.html.erb” partial into whatever element has the id = ‘form_area’.

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

Sidebar

Related Questions

I am using rails 2.3. I want to load parts of a page with
Does anyone know how I can load a Ruby on Rails partial into a
I'm using Rails UJS to load partials into a container depending on the link
I am using Ruby on Rails and am trying to load a page which
I am using Ruby on Rails 3.0.7 and I am planning to use partial
I'm using Rails 3.2 and have a migration that contains the code: add_column :users,
Using Rails v2.1, lets say you have an action for a controller that is
Using Rails 3.1.3 with Ruby 1.9.3p0. I've discovered that by default, Rails does not
Using Rails 3.1.3 and Ruby 1.9.3. I want to give the user a list
My Rails 3 app has a UserAction object that I use to store information

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.