Ok Cool, thank you. On Apr 16, 2:31 pm, Tom Mac <[email protected]> wrote: > Hi > > > MODEL: > > class Contract < ActiveRecord::Base > > > def formdate_string > > formdate.to_s(:db) > > end > > > def formdate_string=(fdate_str) > > self.formdate = Time.parse(fdate_str) > > end > > > end > > This happens when in the new does not get value And as one of the > post in the railscast page suggest it can be solved with an instance > varibale like > > def formdate_string > �...@formdate_string || (formdate.to_s(:db) unless formdate.nil?) > end > > def formdate_string=(fdate_str) > �...@formdate_string = fdate_str > self.formdate = Date.parse(@formdate_string) > rescue ArgumentError > @formdate_invalid = true > end > > �...@formdate_invalid can be used in def validate > > Tom > -- > 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 [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group > athttp://groups.google.com/group/rubyonrails-talk?hl=en.
-- 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

