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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T21:53:28+00:00 2026-05-31T21:53:28+00:00

My ajaxy calls weren’t working, then it randomly started working, then it stopped working

  • 0

My ajaxy calls weren’t working, then it randomly started working, then it stopped working when I added more coffeescript. I removed the added coffeescript and still, no worky.

I noticed that rails.js isn’t being loaded (via inspection by firebug/Chrome inspector). Has rails.js been replaced by jquery_ujs.js in rails 3.2.1? I started a new project and noticed that rails.js wasn’t there either.

Here’s the form:

<%= form_tag("#{tybleau_api_path}.json", remote: true, id: "sportForm", :'data-type' => 'json' ) do%>
    <%= select_tag("state", options_from_collection_for_select(@states, "HometownState", "HometownState"), prompt: "Choose a State", class: "submittable") %>
    <%= submit_tag "Update View" %>
<% end %>

The console is showing this when I click “Update View”:

Started POST "/tybleau/api.json" for 127.0.0.1 at 2012-03-22 17:40:03 -0700
Processing by TybleauController#api as JSON
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"I6752Fit6cCIuASMr4/FD+yLTEBrS2oPhnNBbJQE67k=", "state"=>"AZ", "commit"=>"Update View"}
  Player Load (745.1ms)  SELECT FirstName FROM `players` INNER JOIN `players_to_teams` ON `players_to_teams`.`player_id` = `players`.`id` INNER JOIN `teams` ON `teams`.`id` = `players_to_teams`.`team_id` WHERE `teams`.`SportTypeId` = 2 AND `players`.`hometownstate` = 'AZ'
  EXPLAIN (0.4ms)  EXPLAIN SELECT FirstName FROM `players` INNER JOIN `players_to_teams` ON `players_to_teams`.`player_id` = `players`.`id` INNER JOIN `teams` ON `teams`.`id` = `players_to_teams`.`team_id` WHERE `teams`.`SportTypeId` = 2 AND `players`.`hometownstate` = 'AZ'
EXPLAIN for: SELECT FirstName FROM `players` INNER JOIN `players_to_teams` ON `players_to_teams`.`player_id` = `players`.`id` INNER JOIN `teams` ON `teams`.`id` = `players_to_teams`.`team_id` WHERE `teams`.`SportTypeId` = 2 AND `players`.`hometownstate` = 'AZ'
+----+-------------+------------------+--------+---------------+---------+---------+----------------------------------------------+--------+-------------+
| id | select_type | table            | type   | possible_keys | key     | key_len | ref                                          | rows   | Extra       |
+----+-------------+------------------+--------+---------------+---------+---------+----------------------------------------------+--------+-------------+
|  1 | SIMPLE      | players_to_teams | ALL    | NULL          | NULL    | NULL    | NULL                                         | 260239 |             |
|  1 | SIMPLE      | players          | eq_ref | PRIMARY       | PRIMARY | 4       | mysql_development.players_to_teams.player_id |      1 | Using where |
|  1 | SIMPLE      | teams            | eq_ref | PRIMARY       | PRIMARY | 4       | mysql_development.players_to_teams.team_id   |      1 | Using where |
+----+-------------+------------------+--------+---------------+---------+---------+----------------------------------------------+--------+-------------+
3 rows in set (0.00 sec)

Completed 200 OK in 1034ms (Views: 154.7ms | ActiveRecord: 825.9ms)

So I know it’s working. If I remove the call to remote: true, I get the expected result as a json object.

Here’s my coffeescript:

jQuery ->
  $("#sportForm")
  .bind 'ajax:beforeSend', (xhr, settings) ->
    alert 'loading'
  .bind 'ajax:success', (data, status, xhr) ->
    alert 'success'
  .bind 'ajac:complete', (xhr, status) ->
    alert 'success'
  .bind 'ajax:error', (xhr, status, error) ->
    alert 'error'

Is there a typo or something in there? Should rails.js be viewable in firebug?

Thanks

  • 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-31T21:53:30+00:00Added an answer on May 31, 2026 at 9:53 pm

    Turns out the problem was with SlickGrid. Either SlickGrid or one of the required jQuery-UI libraries was having some naming problem and was stealing the focus of the ajax responses. I’ve decided to use something other than SlickGrid, so I never fully diagnosed the problem, but it’s working nothing.

    Note

    In Rails 3.2.1, there is no rails.js, it’s jquery_ujs.js.

    Thanks for the help

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

Sidebar

Related Questions

I am using Ajaxy Call to load the partial view. It is working fine
As jquery ajax calls makes life really cool without a page refresh... But still
I am working on a .NET 2.0 winforms application that calls an ASP.NET 2.0
i am making ajax calls with jquery like this http://pastie.org/860837 and sometimes i get
I'm making AJAX calls to a server that sometimes return unparseable JSON. The server
I use jQuery to do AJAX calls. But specialchars like ÆØÅ (danish letter) comes
Is there any limitations on AJAX Calls with ScriptManager to Web Services? I have
What is the difference between those two AJAX calls and why would I choose
Does Asp.Net require ActiveX to make Ajax calls? I suspect it does because without
The problem: I make jQuery .ajax calls by clicking on some cursor images in

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.