Skip to content

Instantly share code, notes, and snippets.

@pitluga
Created August 23, 2011 02:56
Show Gist options
  • Save pitluga/1164228 to your computer and use it in GitHub Desktop.
Save pitluga/1164228 to your computer and use it in GitHub Desktop.
simple validation
def validate(params_hash)
errors = {}
errors[:model] = "is required" if params_hash[:model].nil?
errors[:pk] = "is required" if params_hash[:pk].nil?
errors
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment