I need to use the level option for my app, so I did ''gem install
validatable''
Next I got an error when it tried to run, so after some searching,
''require ''validatable'' in environment.rb
Now it says ''Unknown key(s): level'' when a view tries to
render a
partial from that model..
class Person < ActiveRecord::Base
  include Validatable
	belongs_to :household
  validates_numericality_of :month_int, :level => 1
  validates_numericality_of :day_int, :level => 1
  validates_numericality_of :year_int, :level => 1
  validates_presence_of :sex, :m, :d, :y
  validates_length_of :sex, :is => 1
  validates_date :birthday, :after => Date.new(1900, 1, 1), :before =>
Proc.new { 1.day.from_now.to_date }, :before_message => ''Ensure it
is
before %s'', :after_message => ''Ensure it is after
%s'', :level => 2
  before_validation do
  #  debugger
    self.month_int = self.m.to_i
    self.day_int = self.d.to_i
    self.year_int = self.y.to_i
  end
  after_validation do
    debugger
    self.birthday = Date.new(self.year_int, self.month_int,
self.day_int)
  end
end
Please help..
-- 
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
Hi,
      You just add include Validatable in your model after installing 
validatable gem. level option will work with active record validation. 
For more information refer this url - http://validatable.rubyforge.org/
-- 
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
I think that''s what I did. I know the gem is running because I had validates_numericality using minimum and maximum, which broke as soon as I installed the gem. Validatable doesn''t have those options. The include is on line 2 of the model. Bob On May 3, 6:53 am, Priyanka Pathak <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hi, > You just add include Validatable in your model after installing > validatable gem. level option will work with active record validation. > For more information refer this url -http://validatable.rubyforge.org/ > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org 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.
On May 4, 5:27 am, Bob Smith <bsm...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I think that''s what I did. I know the gem is running because I had > validates_numericality using minimum and maximum, which broke as soon > as I installed the gem. Validatable doesn''t have those options. The > include is on line 2 of the model. >Can you isolate which validation is causing the issue ? just looking at the docs for validatable, looks like it might not have a validates_date method - you''re picking up the Active Record validates_date which of course doesn''t expect a :level option Fred> Bob > > On May 3, 6:53 am, Priyanka Pathak <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: > > > Hi, > > You just add include Validatable in your model after installing > > validatable gem. level option will work with active record validation. > > For more information refer this url -http://validatable.rubyforge.org/ > > > -- > > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org 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.