activeadmin_addons icon indicating copy to clipboard operation
activeadmin_addons copied to clipboard

state column i18n

Open jundihuang opened this issue 8 years ago • 1 comments

  # 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

image

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

jundihuang avatar Jan 23 '18 08:01 jundihuang

zh-CN:
  active_admin:
    status_tag:
      pending: 待定
      first approved: 初审通过
      final approved: 终审通过

first_approved -> first approved

it work

jundihuang avatar Jan 23 '18 08:01 jundihuang