class Card::Bootstrap::Component::HorizontalForm
Public Instance Methods
checkbox(_text, _extra_args)
click to toggle source
# File lib/card/bootstrap/component/horizontal_form.rb, line 53 def checkbox _text, _extra_args @html.div class: "col-sm-offset-#{left_col_width} col-sm-#{right_col_width}" do @html.div class: "checkbox" do label_cllabel do inner_input "checkbox" end end end end
input(type, label:, id: label_col label, id: id)
click to toggle source
# File lib/card/bootstrap/component/horizontal_form.rb, line 31 def input type, label:, id: label_col label, id: id @html.div class: "col-sm-#{right_col_width}" do @html.input type: type, id: id, class: "form-control" end # block.call class: "col-sm-#{right_col_width}" do # inner_input opts.merge(type: type) # end end
label_col(label, id: @html.label label, for: id, class: "col-sm-
click to toggle source
def_div_method :input, nil do |opts, extra_args, &block|
type, label = extra_args prepend { tag(:label, nil, for: opts[:id]) { label } } if label insert { inner_input opts.merge(type: type) } { class: "col-sm-#{right_col_width}" }
end
# File lib/card/bootstrap/component/horizontal_form.rb, line 27 def label_col label, id: @html.label label, for: id, class: "col-sm-#{left_col_width} control-label" end
left_col_width()
click to toggle source
# File lib/card/bootstrap/component/horizontal_form.rb, line 5 def left_col_width @child_args.last && @child_args.last[0] || 2 end
right_col_width()
click to toggle source
# File lib/card/bootstrap/component/horizontal_form.rb, line 9 def right_col_width @child_args.last && @child_args.last[1] || 10 end