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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:18:39+00:00 2026-05-26T13:18:39+00:00

I have a rails layout form with multiple partials making up the page: Layout:

  • 0

I have a rails layout form with multiple partials making up the page:

Layout:
  Header (partial)
  Left tree (partial)
  Main area (partial)

When the user makes changes in the main area I want to update the left tree (which is a partial) to represent the change. I would do that with ajax but how would I use refresh it with a partial (the problem is how do I return a partial from the controller which can be used by the JQuery function).

Johann

  • 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-26T13:18:40+00:00Added an answer on May 26, 2026 at 1:18 pm

    As I see it, you have 2½ possibilities:

    • Create a new controller action to return just this partial without
      layout
    • Or re–use the existing controller action and return the
      partial if the action is requested using an xhr request.
    • Use Javascript template such as mustache, haml-js or ejs

    The first option is a bit icky, but somewhat acceptable IMO. You might want to check widgets in this case as well: http://apotomo.de/

    The second option is similar to the first one, but not really acceptable IMO, since you’re returning different stuff from the same “endpoint”.

    The last approach seems best, but might be a bit overkill, depending on your application. Like this your controller can return JSON only and you render the view in the client. Depending on how your application is structured, you might want to have a look at a Javascript MVC solution such as Backbone as well.

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

Sidebar

Related Questions

I have an application layout in my rails app to give a default header/footer
I have this Rails 1.2.6 form: <%= form_tag(:action => login_in_user) %> <p> <label for=header>Username</label>
I have a rails application where each user has a separate database. (taking Joel
I have a rails form with a datetime_select field. When I try to submit
I have a form, and for layout (and future use), i would like to
I have a rails app with core features (layout, users, messaging etc) and 3
Environment: Rails 3.0.4 and Ruby 1.9.2 I have the following form: <%= form_tag( {:action
I am trying to layout out a form using a table. I use rails
I have a Rails 3.1 application with an usual file layout. Heroku detects it
I have a Rails-based site with a basic two-column layout. On the right is

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.