app/helpers/application_helper.rb
#requires a div with id "AJAX_status" to be included in the page
requires a div with id "AJAX_status" to be included in the page
requires a div with id " AJAX_status " to be included in the page
def ajax_alert(page, content, delay_length = 2.5)
    rand = "rand"+rand(10000).to_s 
    page.insert_html :top, "AJAX_status", "<div id='#{rand}' class='AJAX_alert'>#{content}</div>"
    page[rand].visual_effect :slide_down
    page[rand].visual_effect :highlight
    page.delay(delay_length) do
      page[rand].visual_effect :slide_up
    end
  end
def ajax_alert ( page , content , delay_length = 2.5 ) rand = "rand" + rand ( 10000 ) . to_s page . insert_html :top , "AJAX_status" , "<div id='#{rand}' class='AJAX_alert'>#{content}</div>" page [ rand ] . visual_effect :slide_down page [ rand ] . visual_effect :highlight page . delay ( delay_length ) do page [ rand ] . visual_effect :slide_up end end
requires a div with id "AJAX_status" to be included in the page
requires a div with id " AJAX_status " to be included in the page
#unique id for element
page
content
delay_length