Permalink
Browse files

Small #label method refactoring, thanks @rafaelfranca

  • Loading branch information...
1 parent 889bb4b commit 806f4d8af078884db3b68facb4c04560d449b9eb @avakhov avakhov committed Apr 1, 2012
Showing with 2 additions and 3 deletions.
  1. +2 −3 actionpack/lib/action_view/helpers/tags/label.rb
@@ -34,7 +34,6 @@ def render(&block)
if block_given?
content = @template_object.capture(&block)
- label_tag(name_and_id["id"], content, options)
else
content = if @content.blank?
@object_name.gsub!(/\[(.*)_attributes\]\[\d\]/, '.\1')
@@ -56,9 +55,9 @@ def render(&block)
end
content ||= @method_name.humanize
-
- label_tag(name_and_id["id"], content, options)
end
+
+ label_tag(name_and_id["id"], content, options)
end
end
end

0 comments on commit 806f4d8

Please sign in to comment.