Sha256: 5b093e1c5ce4756e212bcb95fee2d5aae8f07a4056f7e88a3495e9a45de83967

Contents?: true

Size: 382 Bytes

Versions: 2

Compression:

Stored size: 382 Bytes

Contents

# frozen_string_literal: true

module Shimmer
  module Form
    class RadioField < Field
      self.type = :radio

      def prepare
        @value = options.delete(:value)
      end

      def render
        builder.radio_button method, @value, options
      end

      def wrapper_options
        {label_method: :"#{method}_#{@value.to_s.underscore}"}
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
shimmer-0.0.41 lib/shimmer/form/radio_field.rb
shimmer-0.0.40 lib/shimmer/form/radio_field.rb