Sha256: 233c9a6cafb9b65b9b9fa945e42e85d691407279bcf73de28506b79db720a3cb

Contents?: true

Size: 947 Bytes

Versions: 6

Compression:

Stored size: 947 Bytes

Contents

module ActionView
  module Helpers
    module FormHelper
      def form_for_with_furatto(record, options = {}, &block)
        options[:builder] ||= Furatto::FormBuilder
        options[:html] ||= {}
        options[:auto_labels] = true unless options.has_key? :auto_labels
        form_for_without_furatto(record, options, &block)
      end

      def fields_for_with_furatto(record_name, record_object = nil, options = {}, &block)
        options[:builder] ||= Furatto::FormBuilder
        options[:html] ||= {}
        options[:html][:attached_labels] = options[:attached_labels]
        options[:auto_labels] = true unless options.has_key? :auto_labels
        fields_for_without_furatto(record_name, record_object, options, &block)
      end

      alias_method_chain :form_for, :furatto
      alias_method_chain :fields_for, :furatto
    end
  end
end

ActionView::Base.field_error_proc = Proc.new do |html_tag, instance_tag|
  html_tag
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
furatto-1.5.0 lib/furatto_rails_helpers/action_view_form_builder_extension.rb
furatto-1.4.0 lib/furatto_rails_helpers/action_view_form_builder_extension.rb
furatto-1.3.7 lib/furatto_rails_helpers/action_view_form_builder_extension.rb
furatto-1.2.7 lib/furatto_rails_helpers/action_view_form_builder_extension.rb
furatto-1.2.6 lib/furatto_rails_helpers/action_view_form_builder_extension.rb
furatto-1.2.5 lib/furatto_rails_helpers/action_view_form_builder_extension.rb