Hi everybody ! I can''t find validation for date. In my form I use form.date_select. How I can protect this field from selection for egzample "month-> February, day -> 30". ActiveRecord don''t save it, but error will raise. I would like to serve this error in this same way as other kind of validation. Similar problem is when we have form.date_select :date_attribute, {:include_blank => true}. Then strange date save possibly, when not all three parts was selected, for egzample only month but not year and day. Always first part is as year and missing data are filled with 1. How I can via validation indicate my user which part of date he/she has forgetten fill. Theoretically we have validates_format_of with option :with, but I couldn''t find it as useful in this case. Maybe I''m wrong. What kind of strategy I should choice? -- Posted via 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 groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I use the calendar control from datetime.toolbocks.com. It takes care of preventing invalid dates such as February 30th. On May 22, 7:44 pm, Walde Man <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hi everybody ! > I can''t find validation for date. > In my form I use form.date_select. > How I can protect this field from selection for egzample "month-> > February, day -> 30". > ActiveRecord don''t save it, but error will raise. I would like to serve > this error in this same way as other kind of validation. > Similar problem is when we have > form.date_select :date_attribute, {:include_blank => true}. > Then strange date save possibly, when not all three parts was selected, > for egzample only month but not year and day. Always first part is as > year and missing data are filled with 1. > How I can via validation indicate my user which part of date he/she has > forgetten fill. > Theoretically we have validates_format_of with option :with, but I > couldn''t find it as useful in this case. Maybe I''m wrong. > What kind of strategy I should choice? > > -- > 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 groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
If you check the TRUNK, you''ll notice it will solve any RJS problems you may have had with older versions causing errors. Also couple fixes in there for Modal windows so it shows up on top. Official release coming soon! :) Nathaniel. On 5/22/07, Myron Marston <myron.marston-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > I use the calendar control from datetime.toolbocks.com. It > takes care of preventing invalid dates such as February 30th. > > > On May 22, 7:44 pm, Walde Man <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > wrote: > > Hi everybody ! > > I can''t find validation for date. > > In my form I use form.date_select. > > How I can protect this field from selection for egzample "month-> > > February, day -> 30". > > ActiveRecord don''t save it, but error will raise. I would like to serve > > this error in this same way as other kind of validation. > > Similar problem is when we have > > form.date_select :date_attribute, {:include_blank => true}. > > Then strange date save possibly, when not all three parts was selected, > > for egzample only month but not year and day. Always first part is as > > year and missing data are filled with 1. > > How I can via validation indicate my user which part of date he/she has > > forgetten fill. > > Theoretically we have validates_format_of with option :with, but I > > couldn''t find it as useful in this case. Maybe I''m wrong. > > What kind of strategy I should choice? > > > > -- > > Posted viahttp://www.ruby-forum.com. > > > > >-- Nathaniel Steven Henry Brown Toll Free: 1-877-446-4647 Vancouver: 604-724-6624 --~--~---------~--~----~------------~-------~--~----~ 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 groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---