Im trying to remember the way in which you can call a method but tell it not to return and I think it was ''and end,'' or something like that? An example would be, render :partial => ''test'', and end Is that correct or did I dream this whole thing? Thanks, -Shandy -- 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 -~----------~----~----~----~------~----~------~--~---
On 8/31/07, Shandy Nantz <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Im trying to remember the way in which you can call a method but tell it > not to return and I think it was ''and end,'' or something like that? An > example would be, > > render :partial => ''test'', and end > > Is that correct or did I dream this whole thing? Thanks,what do you mean "call a method but tell it not to return"? Do you not want the method to return a value? Do you not want the method to return at all, thereby blocking the process? Adam --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Aug 31, 2007, at 12:19 PM, Adam Cohen wrote:> On 8/31/07, Shandy Nantz <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: >> >> Im trying to remember the way in which you can call a method but >> tell it >> not to return and I think it was ''and end,'' or something like >> that? An >> example would be, >> >> render :partial => ''test'', and end >> >> Is that correct or did I dream this whole thing? Thanks, > > what do you mean "call a method but tell it not to return"? Do you > not want the method to return a value? Do you not want the method to > return at all, thereby blocking the process? > > AdamGoing by your example and assuming that you just have it a bit wrong... render :partial => ''test'' and return ...which will do the render, but then return from the method (this is just Ruby syntax). The side-effect of this to avoid the rest of the method and is often used when doing error handling (like: redirect_to :action => ''index'' and return) -Rob Rob Biedenharn http://agileconsultingllc.com Rob-xa9cJyRlE0mWcWVYNo9pwxS2lgjeYSpx@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Rob Biedenharn wrote:> On Aug 31, 2007, at 12:19 PM, Adam Cohen wrote: >>> Is that correct or did I dream this whole thing? Thanks, >> >> what do you mean "call a method but tell it not to return"? Do you >> not want the method to return a value? Do you not want the method to >> return at all, thereby blocking the process? >> >> Adam > > Going by your example and assuming that you just have it a bit wrong... > > render :partial => ''test'' and return > > ...which will do the render, but then return from the method (this is > just Ruby syntax). The side-effect of this to avoid the rest of the > method and is often used when doing error handling (like: > redirect_to :action => ''index'' and return) > > -Rob > > Rob Biedenharn http://agileconsultingllc.com > Rob-xa9cJyRlE0mWcWVYNo9pwxS2lgjeYSpx@public.gmane.organd return, that''s it. What I want to happen is to check to see if a condition is met, like to many characters in a text field; if that''s true display an error message and start over, hence the ''and return.'' And maybe I might have the concept wrong in my head, but I was thinking that if it fails why continue, in which case just return. Thanks Rob -- 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 -~----------~----~----~----~------~----~------~--~---