No, this is not a real Sinatra error :).
This is the personal homepage of Elad Meidar, a web developer and an entrepreneur specializing in Ruby on Rails. I hang around in Israel, and i am currently having the best time of my life over at Fiverr.com
I am a proud member of RailsBridge, Helping new Rails developers get into our world and also contributed a few Patches to the Ruby on Rails core.
i keep forgetting that, so i post it here for me and everyone else.
Here is the list of validations which you can perform on user input:
Following check that last_name and first_name should be filled and should not be NOLL.
validates_presence_of :firstname, :lastname
Following example shows various validations on a single filed. These validations can be performed separately.
Following will accept only ‘Y’ value for option field.
The fields password and password_confirmation must match and will be used as follows:
Following puts a condition for user_name to be unique.
Following validates a that given email ID is in a valid format. This shows how you can use regualr expression to validatea filed.
This validates that given field is numeric.
Following checks that passed value is an enumeration and falls in the given range.
Following checks that given values does not fall in the given range.
Following checks that given values should fall in the given range. This is opposite to validates_exclusion_of.
This validates that the associated object is valid.
You can use following options alongwith all the validations.
:message => ‘my own errormessage’ Use this to print a custom error message in case of validation fails.
:on => :create or :update This will be used in such cases where you want to perform validation only when record is being created or updated. So if you use :create then this validation work only when there is a create opration on database.
Check the following link for more detail on Validations.
You're seeing this error because I think it is funny.