Skip to content

Instantly share code, notes, and snippets.

@Anjen1
Created August 3, 2010 20:30
Show Gist options
  • Save Anjen1/507096 to your computer and use it in GitHub Desktop.
Save Anjen1/507096 to your computer and use it in GitHub Desktop.
validations with conditions-----------
attr_accessor :pervalidations
with_options :if => Proc.new{|a| a.pervalidations} do |form|
form.validates_presence_of :first_name, :message => "^Please enter your first name"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment