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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:55:10+00:00 2026-06-16T01:55:10+00:00

I have a a sidebar that like this; <div id = sidebar-links> <% @locations.each

  • 0

I have a a sidebar that like this;

<div id = "sidebar-links">
      <% @locations.each do |locs| %>
        <p style = "border-bottom: 1px black solid">
        <a href = "#" class = "sidebar-click"><%= locs['Address'] %></a></p>
      <% end %>
    </div>

I want to render a partial in another div id = "container"whenever one of the side bar links is clicked and also want to pass locs as a local variable to that partial;

How would I go about doing that?

  • 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-16T01:55:11+00:00Added an answer on June 16, 2026 at 1:55 am

    First of all try using the link_to helper method:

    <%= link_to locs['Address'], ajax_link, :remote => true, :html => {:class => "sidebar-click"} %>
    

    Then you should create a js bind to handle that ajax response, something like:

    $(function() { 
      $(".sidebar-click").bind("ajax:success",  
        function(event, data){  
          $("#container").html(data);  
      });  
    }); 
    

    UPDATE:
    please check the following documentation:
    http://apidock.com/rails/ActionView/Helpers/PrototypeHelper/link_to_remote

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

Sidebar

Related Questions

I have a simple sidebar like this: <div class=sidebar> <ul class=nav> <li class=Page1><a href=Page1.html>Page1</a></li>
Let's assume i have HTML markup like this: <body> <div id=content> <div id=sidebar> </div>
I've got an html ul tag where I have something like this: <div id=sidebar>
I have a sidebar that I want to behave like it's frozen on the
I have in a sidebar: <div id=yyy> [shortcode]</div> It outputs a title that when
In this html I basically have a sidebar-div and a page-div with the header,
When doing something like this: <div style=float: left;>Left Div</div> <div style=float: right;>Right Div</div> I
I have a page with a sidebar that can change its function. Each different
I have a sidebar list of links in my wikispace theme that currently uses
I have a page where I divided things like this: a div for the

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.