Sha256: 4f1f3cd32c5e17b106b77599faf217ca2337501fcba94f9c27bc0f9788fc79df

Contents?: true

Size: 446 Bytes

Versions: 25

Compression:

Stored size: 446 Bytes

Contents

class AdminEnumInput < SimpleForm::Inputs::CollectionSelectInput
  def input
    super
    @builder.collection_select(
      attribute_name, @builder.object.class.const_get(attribute_name.to_s.upcase),
      :first, :last,
      prompt: I18n.t("#{@builder.object.class.to_s.gsub(/^.*::/, '').downcase}.lista_#{attribute_name}.selecione",
                default: I18n.t("messages.select")),
      input_html: {:class=> 'chosen'}
    )
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
carnival-0.0.34 app/inputs/admin_enum_input.rb
carnival-0.0.33 app/inputs/admin_enum_input.rb
carnival-0.0.26 app/inputs/admin_enum_input.rb
carnival-0.0.11 app/inputs/admin_enum_input.rb
carnival-0.0.10 app/inputs/admin_enum_input.rb