Module: ForemanOrchestration::LayoutHelperExtensions

Extended by:
ActiveSupport::Concern
Defined in:
app/helpers/concerns/foreman_orchestration/layout_helper_extensions.rb

Instance Method Summary collapse

Instance Method Details

#selectable_tag(name, options_tags = nil, options = {}) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/helpers/concerns/foreman_orchestration/layout_helper_extensions.rb', line 5

def selectable_tag(name, options_tags = nil, options = {})
  (:div, :class => 'clearfix') do
    (:div, :class => 'form-group') do
      label = label_tag(name, options.delete(:label), :class => 'col-md-3 control-label')
      help = help_inline(:indicator, '')
      add_help_to_label('col-md-4', label, help) do
        addClass options, 'form-control'
        select_tag name, options_tags, options
      end + if block_given?
        (:div, :class => 'col-md-2') do
          yield
        end
      end
    end
  end
end