Sha256: 626769ada6a40c7772272dea9d100ccc83868e37cf078cc599453151699713bb

Contents?: true

Size: 567 Bytes

Versions: 4

Compression:

Stored size: 567 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

4 entries across 4 versions & 3 rubygems

Version Path
upgrade_surveyor-1.4.2 lib/surveyor/helpers/formtastic_custom_input.rb
affectiva-surveyor-1.5.0.pre.disco.2 lib/surveyor/helpers/formtastic_custom_input.rb
surveyor-1.4.0 lib/surveyor/helpers/formtastic_custom_input.rb
surveyor-1.3.0 lib/surveyor/helpers/formtastic_custom_input.rb