Sha256: c6ca4f4ee6492cf724bd9d89bcf416b7b5cd6307de52f84f082000903e5f5808

Contents?: true

Size: 387 Bytes

Versions: 1

Compression:

Stored size: 387 Bytes

Contents

require 'fields/controllers/main_controller'

module Fields
  class SelectRadioController < MainController
    def options
      attrs.options.then do |options|
        if options[0].is_a?(Hash)
          options_hash = options
        else
          options_hash = options.collect { |option| {value: option, label: option }}
        end
        options_hash
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
volt-fields-0.2.0 app/fields/controllers/select_radio_controller.rb