【发布时间】:2014-11-11 20:03:41
【问题描述】:
我正在尝试在 Spree 1.3 的 checkout/payment 期间覆盖以下错误消息
当用户忘记输入信用卡号、月份或 cvv 时,会显示此消息:
Payments source is invalid
module Spree
class CreditCard < ActiveRecord::Base
validates :month, :year, :numericality => { :only_integer => true }
validates :number, :presence => true, :unless => :has_payment_profile?, :on => :create
validates :verification_value, :presence => true, :unless => :has_payment_profile?, :on => :create
上面创建的验证正在发送这个错误消息,我想用更有用的东西覆盖它,比如:Please check the credit card information entered.
有谁知道在验证未通过时如何覆盖创建自定义错误消息。
提前谢谢你。
【问题讨论】:
标签: ruby ruby-on-rails-3 spree