Sha256: f3766b34e655fa41019cd4d9c1710bb7d52e357161f175f99a7749e51686cea9

Contents?: true

Size: 624 Bytes

Versions: 9

Compression:

Stored size: 624 Bytes

Contents

# frozen_string_literal: true

module Archangel
  ##
  # Language select custom input for SimpleForm
  #
  class LanguageInput < SimpleForm::Inputs::CollectionSelectInput
    ##
    # Do not include blank select option
    #
    # @return [Boolean] to skip blank select option
    #
    def skip_include_blank?
      true
    end

    protected

    def collection
      @collection ||= resource_options
    end

    def resource_options
      [].tap do |option|
        Archangel::LANGUAGES.each do |language|
          option << [Archangel.t("language.#{language}.name"), language]
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
archangel-0.4.0 app/inputs/archangel/language_input.rb
archangel-0.3.0 app/inputs/archangel/language_input.rb
archangel-0.0.8 app/inputs/archangel/language_input.rb
archangel-0.0.7 app/inputs/archangel/language_input.rb
archangel-0.0.6 app/inputs/archangel/language_input.rb
archangel-0.0.5 app/inputs/archangel/language_input.rb
archangel-0.0.4 app/inputs/archangel/language_input.rb
archangel-0.0.3 app/inputs/archangel/language_input.rb
archangel-0.0.2 app/inputs/archangel/language_input.rb