I'm using Rails-3.2.1 and working on ajax.

Below is my code and I want to add woking in progress msg while my
function is in progress.

======================================================================
example.html.erb file

<div id="showmsg">
    Once you approve it will publish.
&nbsp;

<span id="status_section">
[&nbsp;
<%= link_to "Approve", {:action=>"approve_status", :id=>params[:id],
:stat=>"approved"}, :remote=>true %>
&nbsp; | &nbsp;
<%= link_to "Reject", {:action=>"approve_status", :id=>params[:id],
:stat=>"rejected"}, :remote=>true %>
&nbsp;]
</span>

</div>
======================================================================
controller method

def approve_status
    @camp_id = params[:id]
    @camp_stat = params[:stat]

    @campaign = Campaign.find_by_id(@camp_id)
    @campaign.approved_status = @camp_stat
  end

======================================================================
example.js.erb file

jQuery.noConflict();
jQuery("#showmsg").hide();
jQuery("#app_stat").html("<%= @camp_stat %>");
======================================================================

How to use ajax complete or success in this?

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to