Sunday, October 30, 2011

[Rails] Re: ActiveModel::Validations in another module?

Frederick,

I seek to create Ruby modules that use ActiveModel::Validations. The
examples I have seen of ActiveModel::Validations all involve including
that module in classes. This is not what I want. I want to involve the
use of ActiveModel::Validations in a module, which I may then choose to
implement as a ruby class (even if after a few more descents via other
modules.)

In short, how do I do get to do the following (or its equivalent) in a
module?

validates :some_attribute, :numericality_of=>{:greater_than => 0,
:allow_blank=>true}

G

--
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@googlegroups.com.
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.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate