Earlier I ask how I could basically do two things at once - have an error message display then had a list of saved stuff display. Now I would like to, instead, have a alert box come up and say something but still render this list of saved membership numbers. I have something like this: render :partial => ''airline_links'', :text => ''<script language="javascript" type="text/javascript">alert(\''Invalid Credit Card Number.\'');</script>'' It doesn''t complain but my partial doesn''t show up either but my pop-up alert box does. Is there a way to do both? Thanks, -S -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
You will need to use rjs to update multiple elements on a page. -Bill Shandy Nantz wrote:> Earlier I ask how I could basically do two things at once - have an > error message display then had a list of saved stuff display. Now I > would like to, instead, have a alert box come up and say something but > still render this list of saved membership numbers. I have something > like this: > > render :partial => ''airline_links'', :text => ''<script > language="javascript" type="text/javascript">alert(\''Invalid Credit Card > Number.\'');</script>'' > > It doesn''t complain but my partial doesn''t show up either but my pop-up > alert box does. Is there a way to do both? Thanks, > > -S >-- Sincerely, William Pratt --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
William Pratt wrote:> You will need to use rjs to update multiple elements on a page. > > -Bill > > Shandy Nantz wrote: >> It doesn''t complain but my partial doesn''t show up either but my pop-up >> alert box does. Is there a way to do both? Thanks, >> >> -S >> > > -- > Sincerely, > > William PrattI did do it by using render :inline render :inline => '' <% for @rentalcar in @user.rentalcarinfos %> <% mystring = @rentalcar.membership_num[@rentalcar.membership_num.length - 4, 4]%> <p><b><%= @rentalcar.company %>:</b> ----------<%= mystring %> <%= link_to_remote \''Delete\'', :url => { :action => \''delete_rental_car\'', :id => @user.id, :rentalcar => @rentalcar.id }, :update => \''add_rentalcar_info\'' %></p> <% end %> <script language="javascript" type="text/javascript"> alert(\''Invalid Rental Car membership number.\''); </script>'' It''s not pretty but it does do what I want it to do. -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Yikes, that looks horrible ;) You should read up on rjs. It''s quite easy, really powerful, and much, much cleaner. -Bill Shandy Nantz wrote:> William Pratt wrote: > >> You will need to use rjs to update multiple elements on a page. >> >> -Bill >> >> Shandy Nantz wrote: >> >>> It doesn''t complain but my partial doesn''t show up either but my pop-up >>> alert box does. Is there a way to do both? Thanks, >>> >>> -S >>> >>> >> -- >> Sincerely, >> >> William Pratt >> > > I did do it by using render :inline > > render :inline => '' > <% for @rentalcar in @user.rentalcarinfos %> > <% mystring = > @rentalcar.membership_num[@rentalcar.membership_num.length - > 4, 4]%> > <p><b><%= @rentalcar.company %>:</b> ----------<%= mystring %> > <%= link_to_remote \''Delete\'', :url => { :action => > \''delete_rental_car\'', :id => @user.id, :rentalcar => @rentalcar.id > }, :update => \''add_rentalcar_info\'' %></p> > <% end %> > <script language="javascript" type="text/javascript"> > alert(\''Invalid Rental Car membership number.\''); > </script>'' > > It''s not pretty but it does do what I want it to do. >-- Sincerely, William Pratt --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---