Sha256: bc1a15fc8affdea97a3ce9fc3c6dadf30bba808fe1fcb1a3fee0702427f66803

Contents?: true

Size: 358 Bytes

Versions: 1

Compression:

Stored size: 358 Bytes

Contents

class CarnivalEnumInput < SimpleForm::Inputs::CollectionSelectInput

  def input(wrapper_options)
    options[:collection] ||= get_collection
    super
  end

  def input_html_classes
    super.push('form-control')
  end

  def get_collection
    object.class.const_get(constant_name)
  end

  def constant_name
    "#{attribute_name.upcase}_ENUM"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
carnival-0.1.2 app/inputs/carnival_enum_input.rb