Permalink
Browse files

Fixed the call to the _undocumented_ InstanceTag. Bad Steven\!

  • Loading branch information...
1 parent 688d30a commit 601cad8cafbaea79cbc16b77d1de0430d7bcdaae Jonathon Brenner committed Nov 30, 2008
Showing with 5 additions and 9 deletions.
  1. +4 −8 app/helpers/application_helper.rb
  2. +1 −1 lib/less_form_builder.rb
@@ -6,17 +6,13 @@ module ApplicationHelper
def less_form_for name, *args, &block
- options = args.last.is_a?(Hash) ? args.pop : {}
- options = options.merge(:builder=>LessFormBuilder)
- args = (args << options)
- form_for name, *args, &block
+ options = args.extract_options!
+ form_for name, *(args << options.merge(:builder=>LessFormBuilder)), &block
end
def less_remote_form_for name, *args, &block
- options = args.last.is_a?(Hash) ? args.pop : {}
- options = options.merge(:builder=>LessFormBuilder)
- args = (args << options)
- remote_form_for name, *args, &block
+ options = args.extract_options!
+ form_for name, *(args << options.merge(:builder=>LessFormBuilder)), &block
end
@@ -29,7 +29,7 @@ def label method, options = {}
"<label for='#{options.delete(:for)}'>#{text}</label>"
else
#need to use InstanceTag to build the correct ID for :for
- ActionView::Helpers::InstanceTag.new(@object_name, method, self, nil, @object).to_label_tag(text, options)
+ ActionView::Helpers::InstanceTag.new(@object_name, method, self, @object).to_label_tag(text, options)
end
end

0 comments on commit 601cad8

Please sign in to comment.