1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Small #label method refactoring, thanks @rafaelfranca

This commit is contained in:
Alexey Vakhov 2012-04-01 10:30:31 +04:00
parent 889bb4b786
commit 806f4d8af0

View file

@ -34,7 +34,6 @@ module ActionView
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,11 +55,11 @@ module ActionView
end
content ||= @method_name.humanize
end
label_tag(name_and_id["id"], content, options)
end
end
end
end
end
end