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:
parent
889bb4b786
commit
806f4d8af0
1 changed files with 2 additions and 3 deletions
|
@ -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,9 +55,9 @@ module ActionView
|
|||
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
|
||||
|
|
Loading…
Reference in a new issue