Could someone point me at an example that do validation “correctly”.
I’ve got a controller, a couple of models, and some views. They work
fine except for the validation.
My model looks like
"
class ContractPayment < ActiveRecord::Base
set_table_name “contract_payment”
set_primary_key “contract_payment_id”
belongs_to :contract, :foreign_key => “contract_id”
validates_presence_of :contract_id, :credit_card_type_code,
:credit_card_type_prefix, :credit_card_expiration_date,
:credit_card_number, :credit_card_validation_code
end
"
How do I trigger this validation and then display error msgs back to
the user?
Thanks,
Jason