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

  • Home
  • SEARCH
  • 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 1062583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T18:38:59+00:00 2026-05-16T18:38:59+00:00

I have two rails applications. In the first application i have the following method

  • 0

I have two rails applications. In the first application
i have the following method in my controller:

def delivery_status
  envelope_id = params[:id]
  render :json => envelope.to_json(:include => [:deliveries, :log_lines])
end

which, if go to the url in my browser, nicely shows my the JSON. Seems ok.
However, if i call this through jQuery, from my second application, using the following:

$(document).ready(function(){
  $('#provisioning_sms_details_dialog').hide();

  $('.get_sms_details').live('click', function(event) {
      var el = $(this),
          data_url = el.attr('data-url');
      $.ajax({
        url: data_url,
        dataType: 'text',
        success: function(data, status, req) {
          alert('received with status' + status)
          alert('received json ' + data);
        }
      });
  });
});

then the right url is hit with the correct parameters but data is always empty.
I first tried using $.getJSON, then$.get to end at $.ajax. I am not sure but it seems i am doing something wrong at server-side.
If i look at the request inside firebug, the response is indeed empty. Yet, i do not understand, if let the browser hit the same url, i get my json object.

Any insights how to solve this?

  • 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-16T18:39:00+00:00Added an answer on May 16, 2026 at 6:39 pm

    Is this a cross domain request? In that case your ajax-request would be of type HEAD, and you would only see an empty body. Ajax calls are restricted by the same origin policy.

    If that is the case, you could look into using JSONP, which would solve the problem.

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

Sidebar

Related Questions

I have the following two lines in my rails 3.2 application. The first one
I have two rails application running at different ports. First at 3000 and the
I have two rails applications. I would like to submit data from one application
I have two Rails 3 applications that will share portions of the same database
I have had this problem w/ two seperate WYSWYG editors in my rails application
I'm working on a Rails application where I have some a set of two
I have the following models in my Rails application: class Shift < ActiveRecord::Base has_many
I have two models/tables in my Rails application: discussions and comments. Each discussion has_many
In rails application I have two models: Food and Drink . Both food and
My Rails application uses STI where I have two different types of Customers. One

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.