I have been seeingthis problem lots and I guess I must always work around it without understand why it''s there, so maybe you all can help me. I have this form: <%= form_remote_tag :update => "credit_card_table", :url => { :action => :add_credit_card, :id => @user }, :failure => ''alert("ERROR")'', :html => { :id => ''credit_card_form'' } %> which checks the validation of a credit card number, adds it to the list if all is good, or pops up an error box if it is not. When it is not valid, the error box comes up but then in the field that I am updating i get: Template is missing Missing template ./script/../config/../app/views/enroll/add_credit_card.rhtml Now, I understand it is going and executing the code in the ''add_credit_card'' method, but there is no ''add_credit_card.rhtml," there isn''t meant to be. I simple want it so that if the validation fails, nothing happens after the user hit ''OK'' on the pop-up box. So I guess my question is, can someone explain why this is happening, and how to fix it? Thx, ~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 -~----------~----~----~----~------~----~------~--~---
Shandy Nantz wrote:> I have been seeingthis problem lots and I guess I must always work > around it without understand why it''s there, so maybe you all can help > me. I have this form: > > <%= form_remote_tag :update => "credit_card_table", :url => { :action => > :add_credit_card, :id => @user }, :failure => ''alert("ERROR")'', :html => > { :id => ''credit_card_form'' } %> > > which checks the validation of a credit card number, adds it to the list > if all is good, or pops up an error box if it is not. When it is not > valid, the error box comes up but then in the field that I am updating i > get: > > Template is missing > Missing template > ./script/../config/../app/views/enroll/add_credit_card.rhtml > > > Now, I understand it is going and executing the code in the > ''add_credit_card'' method, but there is no ''add_credit_card.rhtml," there > isn''t meant to be. I simple want it so that if the validation fails, > nothing happens after the user hit ''OK'' on the pop-up box. > > So I guess my question is, can someone explain why this is happening, > and how to fix it? Thx,When you call a Rails action it needs to return something. By default it tries to return a rendering of the corresponding template. If you don''t have a template you will need to return something else. Typically you will use the "render" method for this. Check the API for details. -- Cheers, - Jacob Atzen --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Shandy Nantz wrote:> I have been seeingthis problem lots and I guess I must always work > around it without understand why it''s there, so maybe you all can help > me. I have this form: > > <%= form_remote_tag :update => "credit_card_table", :url => { :action => > :add_credit_card, :id => @user }, :failure => ''alert("ERROR")'', :html => > { :id => ''credit_card_form'' } %> > > which checks the validation of a credit card number, adds it to the list > if all is good, or pops up an error box if it is not. When it is not > valid, the error box comes up but then in the field that I am updating i > get: > > Template is missing > Missing template > ./script/../config/../app/views/enroll/add_credit_card.rhtml > > > Now, I understand it is going and executing the code in the > ''add_credit_card'' method, but there is no ''add_credit_card.rhtml," there > isn''t meant to be. I simple want it so that if the validation fails, > nothing happens after the user hit ''OK'' on the pop-up box. > > So I guess my question is, can someone explain why this is happening, > and how to fix it? Thx, > > ~SFurther to Jacob''s reply: You will want to add something like: render :action => "form" to your add_credit_card action. -- 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 -~----------~----~----~----~------~----~------~--~---
Hello Shandy, I''m trying to accomplish the same thing. Have you ever found a workaround for this? Shandy Nantz wrote:> I have been seeingthis problem lots and I guess I must always work > around it without understand why it''s there, so maybe you all can help > me. I have this form: > > <%= form_remote_tag :update => "credit_card_table", :url => { :action => > :add_credit_card, :id => @user }, :failure => ''alert("ERROR")'', :html => > { :id => ''credit_card_form'' } %> > > which checks the validation of a credit card number, adds it to the list > if all is good, or pops up an error box if it is not. When it is not > valid, the error box comes up but then in the field that I am updating i > get: > > Template is missing > Missing template > ./script/../config/../app/views/enroll/add_credit_card.rhtml > > > Now, I understand it is going and executing the code in the > ''add_credit_card'' method, but there is no ''add_credit_card.rhtml," there > isn''t meant to be. I simple want it so that if the validation fails, > nothing happens after the user hit ''OK'' on the pop-up box. > > So I guess my question is, can someone explain why this is happening, > and how to fix it? Thx, > > ~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 -~----------~----~----~----~------~----~------~--~---
Never mind I solved it. -- 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 -~----------~----~----~----~------~----~------~--~---
Hello Andy, That unfortunately doesn''t cut it. What render :nothing => true does is, render a blank page. Thanks for you help though I appreciate it. AndyV wrote:> Try > > render :nothing=>true > > On Jul 18 2007, 12:44 pm, Shandy Nantz <rails-mailing-l...@andreas--- 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 -~----------~----~----~----~------~----~------~--~---
render :nothing=>true does just what it advertises...it renders nothing. If you''ve combined that with an :update=>''my_page'' then you will blank out your page. Shandy had indicated that she did not want to render any results; she was only interested in handling a failure. It appears that your situation may be different. If you provide more details I might be able to help. AndyV On Feb 20, 3:51 pm, Selim Hendrickson <rails-mailing-l...@andreas- s.net> wrote:> Hello Andy, > > That unfortunately doesn''t cut it. What render :nothing => true does is, > render a blank page. > > Thanks for you help though I appreciate it. > > AndyV wrote: > > Try > > > render :nothing=>true > > > On Jul 18 2007, 12:44 pm, Shandy Nantz <rails-mailing-l...@andreas- > > -- > Posted viahttp://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 -~----------~----~----~----~------~----~------~--~---
> <%= form_remote_tag :update => "credit_card_table", :url => { :action => > :add_credit_card, :id => @user }, :failure => ''alert("ERROR")'', :html => > { :id => ''credit_card_form'' } %> > > which checks the validation of a credit card number, adds it to the list > if all is good, or pops up an error box if it is not. When it is not > valid, the error box comes up but then in the field that I am updating i > get: > > Template is missing > Missing template > ./script/../config/../app/views/enroll/add_credit_card.rhtmlI''m not sure if this is going to help, but what I ended up doing is have a switch - true if the credit cards was added to the list and false if it was not. Then, in my partial I have a bit of codes that say if !@valid popup an alert box, but either way, the list of credit cards gets redisplayed. And for the record Shandy is a he. No hard feelings, I get that alot. A strange name is what you get when you have hippie parents I guess. Could be worse. Good luck, ~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 -~----------~----~----~----~------~----~------~--~---
> And for the record Shandy is a he. No hard feelings, I get that alot. A > strange name is what you get when you have hippie parents I guess. Could > be worse. Good luck, > > ~SMy apologies... My last name sounds like a female first name and I occasionally get the same thing. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---