Sha256: d72331a8355ffdf1b4606341b718cc38c635ad9fbaab8709cc3483f41c1f3c5c

Contents?: true

Size: 991 Bytes

Versions: 3

Compression:

Stored size: 991 Bytes

Contents

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

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

      alias_method_chain :form_for, :foundation
      alias_method_chain :fields_for, :foundation
    end
  end
end
ActionView::Base.field_error_proc = Proc.new do |html_tag, instance_tag|
  html_tag
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
foundation_rails_helper-1.2.1 lib/foundation_rails_helper/action_view_extension.rb
foundation_rails_helper-1.1.0 lib/foundation_rails_helper/action_view_extension.rb
foundation_rails_helper-1.0.0 lib/foundation_rails_helper/action_view_extension.rb