Ok so not sure if this is possible but it would help out a lot if it is. I am trying to put this validation on one of my forms validates_presence_of :name, :state however I only need this validation to run when they edit this form, not when they create it. is this possible, any suggestions would be greatly appreciated. thanks in advance. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> Ok so not sure if this is possible but it would help out a lot if it > is. I am trying to put this validation on one of my forms > > validates_presence_of :name, :state > > however I only need this validation to run when they edit this form, > not when they create it. is this possible, any suggestions would be > greatly appreciated. thanks in advance.Check the docs... it''s in there. # on - Specifies when this validation is active (default is :save, other options :create, :update). validates_presence_of :name, :state, :on => :update -philip --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
hey thanks that was the trick, much appreciated On Feb 11, 11:54 am, Philip Hallstrom <phi...-LSG90OXdqQE@public.gmane.org> wrote:> > Ok so not sure if this is possible but it would help out a lot if it > > is. I am trying to put this validation on one of my forms > > > validates_presence_of :name, :state > > > however I only need this validation to run when they edit this form, > > not when they create it. is this possible, any suggestions would be > > greatly appreciated. thanks in advance. > > Check the docs... it''s in there. > > # on - Specifies when this validation is active (default is :save, > other options :create, :update). > > validates_presence_of :name, :state, :on => :update > > -philip--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
hey thanks that was the trick, much appreciated On Feb 11, 11:54 am, Philip Hallstrom <phi...-LSG90OXdqQE@public.gmane.org> wrote:> > Ok so not sure if this is possible but it would help out a lot if it > > is. I am trying to put this validation on one of my forms > > > validates_presence_of :name, :state > > > however I only need this validation to run when they edit this form, > > not when they create it. is this possible, any suggestions would be > > greatly appreciated. thanks in advance. > > Check the docs... it''s in there. > > # on - Specifies when this validation is active (default is :save, > other options :create, :update). > > validates_presence_of :name, :state, :on => :update > > -philip--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---