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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:30:17+00:00 2026-05-24T03:30:17+00:00

Is there functionality in RoR to create dynamic panels within a RoR website? What

  • 0

Is there functionality in RoR to create dynamic panels within a RoR website? What I am trying to accomplish in the main page is to be able to update a panel with a click of a navigation button instead of loading up an entirely new page.

Located in Pages View

Here I want to load new content in my dynamicLoadingPanel with a button click in the navButton span in my home.html.erb:

<span id="navButton" class="button">Content2</span>
<div id="dynamicLoadingPanel"></div>

The page I want to show in the dynamicLoadingPanel is the _categoryOne.html.erb file also located under the Pages View folder.

Thanks for your help!

  • 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-24T03:30:18+00:00Added an answer on May 24, 2026 at 3:30 am

    Like the other answers said, you will want to use ajax. Rails has some nice ajax integration with jquery now, via the jquery_ujs.js file and gem. You should start by installing this gem and running the generators that the readme mentions: https://github.com/rails/jquery-ujs

    There’s 4-5 steps to take: in your view, add a remote link along with a div to receive the returned content. Create a .js.erb file named the same as your controller action, a partial that the .js.erb file renders back to your view, and your controller action to handle the remote call. You may have to add a route that matches the controller#action to your new action.

    Then set up your page with a div loading its content from a partial. the partial will get reloaded during the ajax call. This assumes your controller is named sort and your action is album_select.

    <div id="panels">
      <div id="dynamicLoadingPanel">
        <%=render :partial=>'album_select'%>
      </div>
      <%=link_to 'link text', :url=>'/sort/album_select/params', :remote=>'true', :id=>'navButton'%>
    </div>
    

    Or use jquery and an onclick event for your link:

      $("#navButton").bind('click',function(){
        //post to the controller/action/params
        $.post("/sort/album_select?album=100");
      });
    

    In your controller

     def album_select
          @variables_for_your_view
    
          respond_to do |format|
            format.js 
          end
     # or use the new respond_with(@variables), and make sure to declare respond_to in your controller after the class definition
     end
    

    In your album_select.js.erb file

    $("#dynamicLoadingPanel").html("<%=escape_javascript(render :partial=>"album_select")%>");
    

    maybe throw an alert(‘works!’); in here as well to make sure everything is linking up…I find it hard to debug the jquery in the .js.erb files. Double check quotes, javascript escaping, and other easy to miss javascript errors.

    In your partial

    <p>info I just returned with new instance variables and fanciness</p>
    

    Helps to have a javascript debugger on hand, and / or tail -f your log file.

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

Sidebar

Related Questions

Is there any functionality in Java for pausing the program like system(PAUSE); does in
When programming in C++ in Visual Studio 2008, why is there no functionality like
There is a functionality in my module, where the user can scan the number
Say there is some functionality needed for an application under development which could be
Is there any default functionality for arranging JInternalFrames in Java Swing? I would like
Duplicate of Disable browser save password functionality Is there a way to tell the
Is there in Ruby some functionality/syntax to compare two floats with delta? Something similar
Is there any built-in functionality for classical set operations on the java.util.Collection class? My
Is there any built in functionality that enables downloading files from FTP in .NET?
Is there an available API or functionality in cocoa where i can communicate with

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.