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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:03:40+00:00 2026-06-14T08:03:40+00:00

I have rails application that has two view ports that uses the same data.

  • 0

I have rails application that has two view ports that uses the same data. I can get the data in JSON format like this:

$.read(
    '/en/search/fetch_companies',
    { current_location_lat: 72, current_location_lng: 10, bounding_box: 10 },
    function (response) {
        for (var i = 0; i < response.length; i++) {
            var markerPosition = new google.maps.LatLng(response[i].latitude, response[i].longitude);
            var marker = new google.maps.Marker({
                position:markerPosition,
                map:map,
                title:"AJAX!"
                });
        }
    }
);

This code above creates Markers on a Google Maps. The second view port is a simple table.

  <% @companies.each do |company| %>
    <tr>
      <td>
        <address>
          <strong><%= company.name %></strong><br>
          <%= company.address %>
          <br>
          <%= company.city %>,<%= company.province %>
          <br>
          <%= company.postalcode %>
        </address>
      </td>
      <td>
        <%= link_to book_appointment_path(:choose_service, :company_id => company.id), :class => "btn btn-info btn-center-col" do %>
          <i class="icon-time icon-white"></i> Book Appointment
        <% end %>
      </td>
    </tr>
  <% end %>

For now I’ve been sending two requests to get the JSON data. One for the table view and one for the Map. This is not acceptable for me. The Map and the Table need to be fed the same data at once, but since Rails is resolved on the server I cannot fill the table with the JSON data.

Do anyone knows about some a table that plays nicely with Rails, Ajax and pagination?

  • 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-14T08:03:42+00:00Added an answer on June 14, 2026 at 8:03 am

    A good enough answer for this one. I think it’s the cleanest solution given the parameters of this question.

    Basically I create a RESTful service that allows me to search for something and I use the Backbone library to display my results. I requires more work then a simple Rails component since you need to do JS but to support AJAX correctly, it’s the way to go.

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

Sidebar

Related Questions

I have a Ruby on Rails application that has two active environments, Stage and
So I have a rails application that has two different navigation headers. One that
I have a Rails simple application that has two main models. A person model
I have a rails application that has three different types of users and I
I have a Rails application that uses ActiveRecordStore for sessions. I need a PHP
I have a Rails application that unfortunately after a request to a controller, has
I have a Rails application that has to co-exist with a very old legacy
I have a Rails application that has file uploading. Once the file is uploaded
I'm developing a Rails 3 application that has two user types: Teacher and Company.
I'm developing a Rails 3 application that has two user types: Teacher and Company.

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.