Class: Effective::FormInputs::Submit
Constant Summary
Effective::FormInput::BLANK, Effective::FormInput::EXCLUSIVE_CLASS_PREFIXES, Effective::FormInput::EXCLUSIVE_CLASS_SUFFIXES
Instance Attribute Summary
#name, #options
Instance Method Summary
collapse
#hint_options, #initialize, #input_group_options, #input_js_options, #to_html
Instance Method Details
5
6
7
|
# File 'app/models/effective/form_inputs/submit.rb', line 5
def build_input(&block)
icon('spinner') + (block_given? ? capture(&block) : content_tag(:button, name, options[:input]))
end
|
#feedback_options ⇒ Object
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
# File 'app/models/effective/form_inputs/submit.rb', line 36
def feedback_options
false
end
|
28
29
30
|
# File 'app/models/effective/form_inputs/submit.rb', line 28
def input_html_options
{ class: 'btn btn-primary', type: 'submit', name: 'commit', value: name }
end
|
#label_options ⇒ Object
32
33
34
|
# File 'app/models/effective/form_inputs/submit.rb', line 32
def label_options
false
end
|
#wrapper_options ⇒ Object
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'app/models/effective/form_inputs/submit.rb', line 9
def wrapper_options
border = options.key?(:border) ? options.delete(:border) : true
left = options.delete(:left) || false
center = options.delete(:center) || false
right = options.delete(:right) || false
right = true unless (left || center)
classes = [
('row' if layout == :horizontal),
'form-group form-actions',
('form-actions-bordered' if border),
('justify-content-start' if left && layout == :vertical),
('justify-content-center' if center && layout == :vertical),
('justify-content-end' if right && layout == :vertical)
].compact.join(' ')
{ class: classes }
end
|