activeadmin_addons
activeadmin_addons copied to clipboard
state column i18n
# model
enum state: { pending: 1, first_approved: 2, final_approved: 3, rejected: 4}
when state was first_approved or final_approved, the localized doesn't work.
state_column :state

In /addons/state_builder.rb
def render
raise "you need to install AASM gem first" unless defined? AASM
raise "the #{attribute} is not an AASM state" unless state_attribute?
context.status_tag(model.aasm.human_state, class: status_class_for_model)
end
context.status_tag(state)
state should be first_approved ,but not First Approved
zh-CN:
active_admin:
status_tag:
pending: 待定
first approved: 初审通过
final approved: 终审通过
first_approved -> first approved
it work