Skip to content

Commit

Permalink
Fix form helper for forms without a real record.
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerhunt committed Oct 17, 2012
1 parent 9ea9109 commit 4f688b1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/formulate/form_helper.rb
Expand Up @@ -4,9 +4,17 @@ module FormHelper

def form_for(record, options={}, &proc)
options[:html] ||= {}
apply_form_for_options!(record, options)

case record
when String, Symbol
options[:html][:class] ||= ''
else
apply_form_for_options!(record, options)
end

options[:html][:class] << ' formulate'
options[:html][:class] << " #{options[:class]}" if options[:class]
options[:html][:class].strip!

original_field_error_proc = ::ActionView::Base.field_error_proc
::ActionView::Base.field_error_proc = FIELD_ERROR_PROC
Expand Down

0 comments on commit 4f688b1

Please sign in to comment.