diff options
Diffstat (limited to 'actionpack/lib/action_view/helpers/form_helper.rb')
-rw-r--r-- | actionpack/lib/action_view/helpers/form_helper.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb index 22d2984adb..9c31fb6c90 100644 --- a/actionpack/lib/action_view/helpers/form_helper.rb +++ b/actionpack/lib/action_view/helpers/form_helper.rb @@ -158,7 +158,7 @@ module ActionView def form_for(record_or_name_or_array, *args, &proc) raise ArgumentError, "Missing block" unless block_given? - options = args.last.is_a?(Hash) ? args.pop : {} + options = args.extract_options! case record_or_name_or_array when String, Symbol @@ -212,7 +212,7 @@ module ActionView # like FormOptionHelper#collection_select and DateHelper#datetime_select. def fields_for(object_name, *args, &block) raise ArgumentError, "Missing block" unless block_given? - options = args.last.is_a?(Hash) ? args.pop : {} + options = args.extract_options! object = args.first builder = options[:builder] || ActionView::Base.default_form_builder |