Class: HorizontalBootstrapFormBuilder

Inherits:
BootstrapFormBuilder show all
Defined in:
app/helpers/horizontal_bootstrap_form_builder.rb

Instance Method Summary collapse

Methods inherited from BootstrapFormBuilder

#bootstrap_fields_for, create_tagged_field, #cw_image_tag, #datetime_select, #image, #radio, #select

Instance Method Details

#bootstrap_checkbox(name, input) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
# File 'app/helpers/horizontal_bootstrap_form_builder.rb', line 11

def bootstrap_checkbox(name, input)
  @template.("div",
    @template.("div",
      @template.("div",
      raw("<label>#{@template.label_tag(name, input)} #{name.to_s.humanize}</label>"),
        {:class => "checkbox"}
      ), 
      {:class => "col-sm-offset-4 col-sm-8"}
    ),
    {:class => "form-group"}
  )
end

#bootstrap_input(name, input, include_br = false) ⇒ Object



3
4
5
6
7
8
9
# File 'app/helpers/horizontal_bootstrap_form_builder.rb', line 3

def bootstrap_input(name, input, include_br = false)
  @template.("div",
    @template.label_tag(name, nil, :class => "col-sm-4 control-label") +
    @template.("div", input, {:class => "col-sm-8"}),
      {:class => "form-group"}
  ) 
end