I''ve generated model, controller and then I''ve added validation to my model. When I leave my form field empty validation doesn''t appear (validate_presents_of). How can I fixed it?? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
it''s validates_presence_of On 4/9/07, Daniello <danielpwa-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > I''ve generated model, controller and then I''ve added validation to my > model. When I leave my form field empty validation doesn''t appear > (validate_presents_of). How can I fixed it?? > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Yes it''s validates_presence_of On Apr 9, 1:36 pm, "Chris Hall" <christopher.k.h...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> it''s > > validates_presence_of > > On 4/9/07, Daniello <daniel...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > I''ve generated model, controller and then I''ve added validation to my > > model. When I leave my form field empty validation doesn''t appear > > (validate_presents_of). How can I fixed it??--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
what do you mean by ''when i leave my form field''? i have a feeling you are misunderstanding record validation. record validation != form validation record validation occurs when you attempt to save your record to the database after you have submitted the data to the server. if you want to validate the form data before you submit, you will have to write your own functionality to validate it on the page. On 4/9/07, Daniello <danielpwa-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Yes it''s validates_presence_of > > On Apr 9, 1:36 pm, "Chris Hall" <christopher.k.h...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > it''s > > > > validates_presence_of > > > > On 4/9/07, Daniello <daniel...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > > I''ve generated model, controller and then I''ve added validation to my > > > model. When I leave my form field empty validation doesn''t appear > > > (validate_presents_of). How can I fixed it?? > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I''d like to have the same type of validation like I have when I''m using scaffolding. Simple validation of presence something on my form field. On Apr 9, 2:29 pm, "Chris Hall" <christopher.k.h...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> what do you mean by ''when i leave my form field''? i have a feeling > you are misunderstanding record validation. > > record validation != form validation > > record validation occurs when you attempt to save your record to the > database after you have submitted the data to the server. > > if you want to validate the form data before you submit, you will have > to write your own functionality to validate it on the page. > > On 4/9/07,Daniello<daniel...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Yes it''s validates_presence_of > > > On Apr 9, 1:36 pm, "Chris Hall" <christopher.k.h...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > it''s > > > > validates_presence_of > > > > On 4/9/07,Daniello<daniel...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > I''ve generated model, controller and then I''ve added validation to my > > > > model. When I leave my form field empty validation doesn''t appear > > > > (validate_presents_of). How can I fixed it??--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Daniello wrote:> I''d like to have the same type of validation like I have when I''m > using scaffolding. Simple validation of presence something on my > form field.Hey Daniello, Why dont you show us the source of model + controller + view that you use? Gokhan www.sylow.net -- 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 create a form based on your model. submit the data, attempt to save it. if validations fail, the record won''t be saved and will contain errors. you redisplay your form and show your users where the errors were made in the form data. if the record saves, then all is good. it''s a bit much to explain in the mailing list. i suggest you review the generated scaffolding code and read the Rails book if you can. also, google is your friend. On 4/9/07, Daniello <danielpwa-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > I''d like to have the same type of validation like I have when I''m > using scaffolding. Simple validation of presence something on my > form field. > > On Apr 9, 2:29 pm, "Chris Hall" <christopher.k.h...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > what do you mean by ''when i leave my form field''? i have a feeling > > you are misunderstanding record validation. > > > > record validation != form validation > > > > record validation occurs when you attempt to save your record to the > > database after you have submitted the data to the server. > > > > if you want to validate the form data before you submit, you will have > > to write your own functionality to validate it on the page. > > > > On 4/9/07,Daniello<daniel...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > > Yes it''s validates_presence_of > > > > > On Apr 9, 1:36 pm, "Chris Hall" <christopher.k.h...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > it''s > > > > > > validates_presence_of > > > > > > On 4/9/07,Daniello<daniel...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > I''ve generated model, controller and then I''ve added validation to my > > > > > model. When I leave my form field empty validation doesn''t appear > > > > > (validate_presents_of). How can I fixed it?? > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---