Sha256: 8c38b8423a529a2ad60139b4cf0cb8c8208962824d21d3ba61bd4bd643a805e6
Contents?: true
Size: 966 Bytes
Versions: 21
Compression:
Stored size: 966 Bytes
Contents
module DynamicFieldsets # Radio buttons input class RadioField < Field acts_as_field_with_field_options acts_as_field_with_single_answer # Note that the radio buttons need special data per field option # output[:options] contains information for each of the field options for the radio field # # @return [Hash] Data needed for the radio buttons partial def form_partial_locals(args) output = super output[:options] = [] field_options.each do |option| output[:options] << { :name => "#{DynamicFieldsets.config.form_fieldset_associator_prefix}#{args[:fsa].id}[#{DynamicFieldsets.config.form_field_prefix}#{args[:fieldset_child].id}]", :value => option.id.to_s, :checked => value_or_default_for_form(args[:values]).eql?(option.id.to_s), :html_attributes => html_attribute_hash, :label => option.name, } end return output end end end
Version data entries
21 entries across 21 versions & 1 rubygems