<div id="showlist">
<%= link_to_remote "Search",
:url => { :action => "create" },
:update => "showlist",
:loading => "document.getElementById('spinner').style.visibility='visible';" %>
<img src="http://www.insight24.com/view/insight24/img/loading.gif" style="visibility:hidden;" id="spinner">
</div>
Form with Ajax loading image in view.rhtml:
<% remote_form_for :search, @search,
:url => {:action => 'create'},
:loading => "document.getElementById('spinner').style.visibility='visible';",
:update => "showlist" do |f| %>
Keyword: <%= text_field 'search', 'item' %><%= submit_tag "Search"%>
<img src="loading.gif" style="visibility:hidden;" id="spinner">
<% end %>
<div id="showlist"></div>
See also: Simple Ajax Search Engine
Awesome information Keep updating Ruby on Rails Online Training Hyderabad
ReplyDeleteThank you.Well it was nice post and very helpful information on ruby certification
ReplyDelete