Sha256: da3fabfc1a7bde4b5abacedae72472c4535c2622a60e28498a14c0c3459e7b5e

Contents?: true

Size: 568 Bytes

Versions: 3

Compression:

Stored size: 568 Bytes

Contents

module Surveyor
  module Helpers
    module FormtasticCustomInput
      def input_html_options_with(choice, response_class)
        input_html_options.merge(choice_html_options(choice)).merge({:id => (input_html_options[:id] || "answer_id").gsub("answer_id", response_class_to_method(response_class).to_s), :class => [input_html_options[:class], response_class].join(" ")})
      end
      def response_class_to_method(type_sym)
        # doesn't handle response_class == answer, and doesn't have to
        "#{type_sym.to_s}_value".to_sym
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
hssc_surveyor-1.4.3.pre lib/surveyor/helpers/formtastic_custom_input.rb
hssc_surveyor-1.4.2.pre lib/surveyor/helpers/formtastic_custom_input.rb
hssc_surveyor-1.4.1.pre lib/surveyor/helpers/formtastic_custom_input.rb