Problem: View Code:--> <% form_remote_tag :url => get_reports_backend_billing_billing_reports_path,:update => "reports", :complete => "Element.hide(''../images/spinner.gif'')", :loading => "Element.show(''../images/spinner.gif'')" do %> <label> Select Status: </label> <%= select_tag "status",options_for_select(Report::STATUS.collect.insert(0,'''')) %> <%= submit_tag ''Get Reports'' %> <% end %> Controller code:- def reports reports = Report.find_reports(params[:status]) @reports = reports.first if request.post? render :update do |page| page.replace_html "reports_table",:partial => ''reports'' end end end Here form is working fine when i am selecting status .. but when i click on submit spinner image is not coming ... Suppose if i am using :disable_with in the submit_tag it is giving RJS error. Why? Could any help me!!!!!! Thanks in advance -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Lorenzo Brito Morales
2011-Feb-24 07:47 UTC
Re: Problem with spinner image on form_remote_tag
what version of rails are you using? On Thu, Feb 24, 2011 at 12:56 AM, Sai Babu <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Problem: > > View Code:--> > > <% form_remote_tag :url => > get_reports_backend_billing_billing_reports_path,:update => "reports", > :complete => "Element.hide(''../images/spinner.gif'')", :loading => > "Element.show(''../images/spinner.gif'')" do %> > <label> > Select Status: > </label> > <%= select_tag > "status",options_for_select(Report::STATUS.collect.insert(0,'''')) %> > <%= submit_tag ''Get Reports'' %> > <% end %> > > Controller code:- > def reports > reports = Report.find_reports(params[:status]) > @reports = reports.first > if request.post? > render :update do |page| > page.replace_html "reports_table",:partial => ''reports'' > end > end > end > > > Here form is working fine when i am selecting status .. but when i click > on submit spinner image is not coming ... > > Suppose if i am using :disable_with in the submit_tag it is giving RJS > error. > > Why? > Could any help me!!!!!! > > Thanks in advance > > -- > 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Lorenzo Brito Morales wrote in post #983527:> what version of rails are you using?2.3.5 -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 24 February 2011 06:56, Sai Babu <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Problem: > > View Code:--> > > <% form_remote_tag :url => > get_reports_backend_billing_billing_reports_path,:update => "reports", > :complete => "Element.hide(''../images/spinner.gif'')", :loading => > "Element.show(''../images/spinner.gif'')" do %> > <label> > Select Status: > </label> > <%= select_tag > "status",options_for_select(Report::STATUS.collect.insert(0,'''')) %> > <%= submit_tag ''Get Reports'' %> > <% end %> > > Controller code:- > def reports > reports = Report.find_reports(params[:status]) > @reports = reports.first > if request.post? > render :update do |page| > page.replace_html "reports_table",:partial => ''reports'' > end > end > end > > > Here form is working fine when i am selecting status .. but when i click > on submit spinner image is not coming ...Install Firebug in Firefox and see whether it throws up any errors when you click the button. Colin> > Suppose if i am using :disable_with in the submit_tag it is giving RJS > error. > > Why? > Could any help me!!!!!! > > Thanks in advance > > -- > 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Colin Law wrote in post #983543:> On 24 February 2011 06:56, Sai Babu <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >> </label> >> render :update do |page| >> page.replace_html "reports_table",:partial => ''reports'' >> end >> end >> end >> >> >> Here form is working fine when i am selecting status .. but when i click >> on submit spinner image is not coming ... > > Install Firebug in Firefox and see whether it throws up any errors > when you click the button. > > ColinPresently firebug is installed in my system. i have already tested it. it is not throwing any error. But when i am using :disable_with in submit_button it is throwing RJS Error on web page .. Like below format try { Element.update("reports_table", "<table class=\"list\">\n <n RE_PAID\\n </td>\\n <td>\\n NONE\\n </td>\\n <td>\\n NONE\\n </td>\\n <td>\\n \\n </td>\\n <td>\\n 20\\n </td>\\n </tr>\\n \\n <tr id =\\\"row_3\\\" class=\\\"list_item odd\\\" onclick=\\\"highlightLine(row_3)\\\">\\n <td>\\n <td>\\n </td>\\n </tr>\\n \\n \\n </tbody>\\n</table>\\n\");''); throw e } -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Thu, Feb 24, 2011 at 2:56 PM, Sai Babu <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Problem: > > View Code:--> > > <% form_remote_tag :url => > get_reports_backend_billing_billing_reports_path,:update => "reports", > :complete => "Element.hide(''../images/spinner.gif'')", :loading => > "Element.show(''../images/spinner.gif'')" do %> > <label> > Select Status: > </label> > <%= select_tag > "status",options_for_select(Report::STATUS.collect.insert(0,'''')) %> > <%= submit_tag ''Get Reports'' %> > <% end %> > >There''s something wrong with your :loading and :complete arguments. I think Element.hide and Element.show expects an element id. change it to :complete => ''$("spinner").hide();'' :loading => ''$("spinner").show()'' then add this where you like the image to show image_tag ''/images/spinner.gif'', :id => ''spinner''> Controller code:- > def reports > reports = Report.find_reports(params[:status]) > @reports = reports.first > if request.post? > render :update do |page| > page.replace_html "reports_table",:partial => ''reports'' > end > end > end > > > Here form is working fine when i am selecting status .. but when i click > on submit spinner image is not coming ... > > Suppose if i am using :disable_with in the submit_tag it is giving RJS > error. > > Why? > Could any help me!!!!!! > > Thanks in advance > > -- > 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- ------------------------------------------------------------- visit my blog at http://jimlabs.heroku.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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Jim ruther Nill wrote in post #983573:> On Thu, Feb 24, 2011 at 2:56 PM, Sai Babu <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: > >> </label> >> <%= select_tag >> "status",options_for_select(Report::STATUS.collect.insert(0,'''')) %> >> <%= submit_tag ''Get Reports'' %> >> <% end %> >> >> > There''s something wrong with your :loading and :complete arguments. I > think > Element.hide and Element.show > expects an element id. change it to > > :complete => ''$("spinner").hide();'' > :loading => ''$("spinner").show()'' > > then add this where you like the image to show > > image_tag ''/images/spinner.gif'', :id => ''spinner'' > > >> >> Thanks in advance >> For more options, visit this group at >> http://groups.google.com/group/rubyonrails-talk?hl=en. >> >> > > > --Hi Jim ruther Nill Thank You For Suggestion It is working fine with little bit modification I have place this information in form_remote_tag as <% form_remote_tag(:url => { :action=>"get_reports" } ,:before => "$(''spinner'').show();", :complete => ''$("spinner").hide();'') do %> Here i placed my code..... <% end %> So Here i am using these :before => ''$("spinner").show();'', :complete => ''$("spinner").hide();'') i have defined a div called below <div id="spinner"> <%= image_tag "../images/spinner.gif" %> </div> Now it is working fine .............. But if suppose i am using :loading instead of :before it is not showing spinning image.... Why? What is the reason? Ant one Have Any Idea? -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.