Skip to content
Browse files

Remove unused code

  • Loading branch information...
1 parent c048f0b commit ad44ece292d477e05321fff6037a4423c0e53c2f @rafaelfranca rafaelfranca committed
Showing with 0 additions and 39 deletions.
  1. +0 −39 actionpack/lib/action_view/helpers/form_helper.rb
View
39 actionpack/lib/action_view/helpers/form_helper.rb
@@ -940,45 +940,6 @@ def instantiate_builder(record_name, record_object, options, &block)
end
end
- class InstanceTag
- include Helpers::ActiveModelInstanceTag, Helpers::TagHelper, Helpers::FormTagHelper
-
- attr_reader :object, :method_name, :object_name
-
- def initialize(object_name, method_name, template_object, object = nil)
- @object_name, @method_name = object_name.to_s.dup, method_name.to_s.dup
- @template_object = template_object
-
- @object_name.sub!(/\[\]$/,"") || @object_name.sub!(/\[\]\]$/,"]")
- @object = retrieve_object(object)
- @auto_index = retrieve_autoindex(Regexp.last_match.pre_match) if Regexp.last_match
- end
-
- def retrieve_object(object)
- if object
- object
- elsif @template_object.instance_variable_defined?("@#{@object_name}")
- @template_object.instance_variable_get("@#{@object_name}")
- end
- rescue NameError
- # As @object_name may contain the nested syntax (item[subobject]) we need to fallback to nil.
- nil
- end
-
- def retrieve_autoindex(pre_match)
- object = self.object || @template_object.instance_variable_get("@#{pre_match}")
- if object && object.respond_to?(:to_param)
- object.to_param
- else
- raise ArgumentError, "object[] naming but object param and @object var don't exist or don't respond to to_param: #{object.inspect}"
- end
- end
-
- def value(object)
- object.send @method_name if object
- end
- end
-
class FormBuilder
# The methods which wrap a form helper call.
class_attribute :field_helpers

0 comments on commit ad44ece

Please sign in to comment.
Something went wrong with that request. Please try again.