Sha256: bb200797923ec3037d97d07bfe98c224bd14a0bbb2a0f8be9080d50095d7ed27

Contents?: true

Size: 475 Bytes

Versions: 6

Compression:

Stored size: 475 Bytes

Contents

module HungryForm
  module Elements
    class RadioGroup < Base::OptionsElement
      # Sets a value of the element
      # Checks the value from the resolver params against the available options
      def set_value
        if resolver.params.key?(name)
          if options.keys.include?(resolver.params[name])
            self.value = resolver.params[name]
          end
        else
          self.value = attributes.delete(:value)
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
hungryform-0.0.11 lib/hungryform/elements/radio_group.rb
hungryform-0.0.10 lib/hungryform/elements/radio_group.rb
hungryform-0.0.9 lib/hungryform/elements/radio_group.rb
hungryform-0.0.8 lib/hungryform/elements/radio_group.rb
hungryform-0.0.7 lib/hungryform/elements/radio_group.rb
hungryform-0.0.6 lib/hungryform/elements/radio_group.rb