Module: EgovUtils::EnumHelper

Defined in:
app/helpers/egov_utils/enum_helper.rb

Instance Method Summary collapse

Instance Method Details

#enum_values_for_select(klass, method) ⇒ Object



4
5
6
7
# File 'app/helpers/egov_utils/enum_helper.rb', line 4

def enum_values_for_select(klass, method)
  plur_method = method.to_s.pluralize
  klass.send(plur_method).collect{|val, _| [t("activerecord.attributes.#{klass.model_name.i18n_key}.#{plur_method}.#{val}"), val]}
end