Heinz,
If you're looking to invalidate the object based on this non-member field,
you could use
ActiveRecord.Errors.add_to_base()
e.g. @record.errors.add_to_base("Invalid unpopple value")
Then check validity with @record.errors.empty?
Note that @record.is_valid will still return true (unless you override
invalid? for the class).
Hope that helps,
James.
2009/3/17 Heinz Strunk <[email protected]>
>
> But the text_field_tag has nothing to do with the @record so it wouldn't
> help if I was checking if the @record is valid, right?
>
> tony wrote:
> > you could also [email protected]_valid?
> >
> > which will validate w/o saving
> >
> > On Mar 17, 11:00�am, Frederick Cheung <[email protected]>
>
> --
> 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 [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
-~----------~----~----~----~------~----~------~--~---