I have this model:
class Coupon
include ActiveModel::Validations
include ActiveModel::Conversion
extend ActiveModel::Naming
attr_accessor :id
def initialize(attributes = {})
attributes.each do |name, value|
send("#{name}=", value)
end
end
def persisted?
false
end
end
How can I add i18n translations to this model? Specifically:
- How do I translate its model name?
- How do I translate its attributes?
- How do I provide custom translation for its submit button?
I am using SimpleForm.