From db27c4187da7c1e0426d1ff30986e02cbc3de4f5 Mon Sep 17 00:00:00 2001 From: Marek Hulan Date: Fri, 23 Oct 2015 15:18:24 +0200 Subject: [PATCH] Fixes #12280 - fix label for field helper --- app/helpers/layout_helper.rb | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/app/helpers/layout_helper.rb b/app/helpers/layout_helper.rb index 57cdd71cc17e..b6bb0078fd9c 100644 --- a/app/helpers/layout_helper.rb +++ b/app/helpers/layout_helper.rb @@ -239,13 +239,15 @@ def field(f, attr, options = {}) help_block = content_tag(:span, options.delete(:help_block), :class => "help-block") content_tag(:div, :class => "clearfix") do - content_tag :div, :class => "#{wrapper_class} #{error.empty? ? "" : 'has-error'}", - :id => options.delete(:control_group_id) do - input = if options[:fullscreen] - content_tag(:div, yield.html_safe + fullscreen_input, :class => "input-group") - else - yield.html_safe - end + content_tag(:div, :class => "#{wrapper_class} #{error.empty? ? "" : 'has-error'}", + :id => options.delete(:control_group_id)) do + input = capture do + if options[:fullscreen] + content_tag(:div, yield.html_safe + fullscreen_input, :class => "input-group") + else + yield.html_safe + end + end add_help_to_label(size_class, label, help_inline) do input + help_block.html_safe end