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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T22:40:41+00:00 2026-06-01T22:40:41+00:00

I am confusing, where i must put ajax callbacks in rails 3.1, that triggers

  • 0

I am confusing, where i must put ajax callbacks in rails 3.1, that triggers event beforSend that shows string to user “Wait, please” and hide this string when occur succes.

= javascript_tag "$('#form_remote').bind('ajax:beforSend', function() {$("#mess").show();});"
%div{:id => 'mess', :style=>"display:none;"} Wait,please
= form_tag filling_schedule_of_workings_path, :remote => true, :html=>{:id => 'form_remote'} do
  %p{:style=>"margin:0;width:100%"}
    = label_tag 'C '
    = text_field_tag 'date_begin',nil,:size => 10
    = label_tag 'по'
    = text_field_tag 'date_end',nil,:size => 10
  %br
  %p{:style=>"margin:0;width:100%"}
    = label_tag 'Schedule class'
    = select_tag 'classifier_schedule',@classifier_schedule,:style=>"width:200px;"
  %p{:style=>"margin:0;width:100%"}
    = label_tag 'Schedule number'
    = select_tag 'schedule_number',@schedule_number,:style=>"width:200px;"
  %div{:style=>"height:25px;border-top:1px solid #CCC;margin:5px 0;"}
    = submit_tag "Doing", :style => "float:right;"

Is this normal?

Help please!!

  • 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-01T22:40:41+00:00Added an answer on June 1, 2026 at 10:40 pm

    I don’t think this needs to be in your HAML code, the way I typically solve this is to register those events inside the main application JS file. For example, you could do something like this if you wanted a please wait action to appear whenever an AJAX event started:

        /* Display a scrim to prevent mouse clicks when an ajax event is occurring. */
    $.ajaxPrefilter(function(options, originalOptions, jqXHR) {
        if (!$('#progressIndicator').is(":visible")) {
            $('#progressIndicator').show();
        }
    });
    $('head').ajaxStop(function() {
        $('#progressIndicator').hide();
    });
    
    $('head').ajaxComplete(function(event, request, settings) {
        $('#progressIndicator').hide();
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does that title sound confusing? I thought it might well anyways. When I person
I find it confusing that there is an ActiveRecord delete as well as destroy.
I'm writing a COM object that provides access to a service that must be
I'm confusing about 0:M relationship. So, I want to ask about that. Assumes we
We have a Crystal Report that lets the user pick which of several fields
Setting the include path is really confusing me. I must be missing something important.
I want to put a scrollable EditText above a row of buttons such that
I know that in spring I must define welcome-file, which should be outside of
This seems like it must be so simple, but regular expressions are extremely confusing
Hope my title is not too confusing. Please let me know if there is

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.