Sha256: 4fa6225ce824ea314f73199168efd1d2a96d0dd023878f4037e9c6e440ae73d9

Contents?: true

Size: 552 Bytes

Versions: 9

Compression:

Stored size: 552 Bytes

Contents

# frozen_string_literal: true

module Archangel
  ##
  # Theme select custom input for SimpleForm
  #
  class ThemeInput < 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.themes.each { |theme| option << [theme, theme] }
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

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