module FormattedForm require 'formatted_form/engine' if defined?(Rails) require 'formatted_form/builder' module FormattedFormHelper def formatted_form_for(record_or_name_or_array, *args, &proc) options = args.extract_options! options.merge!(:builder => FormattedForm::Builder) (options[:html] ||= { }).merge!(:class => "#{options[:html][:class]} formatted") form_for(record_or_name_or_array, *(args << options), &proc) end end end