I followed the railscast on activemerchant and have this code:
def validate_card
unless credit_card.valid?
credit_card.errors.full_messages.each do |message|
errors.add_to_base message
end
end
end
But that doesn't wrap the field in a fieldWithErrors
div. So I tried:
def validate_card
unless credit_card.valid?
credit_card.errors.each do |error|
errors.add error
end
end
end
That still didn't work. I've read http://api.rubyonrails.org/classes/ActiveResource/Errors.html and http://activemerchant.rubyforge.org/ but I'm not reading them right or something.