Class: Effective::FormInputs::Submit
Constant Summary
Effective::FormInput::BLANK
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)
content_tag(:button, name, options[:input])
end
|
#feedback_options ⇒ Object
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
# File 'app/models/effective/form_inputs/submit.rb', line 25
def feedback_options
case layout
when :inline
false
else
{
valid: { class: 'valid-feedback', text: 'Looks good! Submitting...' },
invalid: {
class: 'invalid-feedback',
text: 'one or more errors are present. please fix the errors above and try again.'
}
}
end
end
|
17
18
19
|
# File 'app/models/effective/form_inputs/submit.rb', line 17
def input_html_options
{ class: 'btn btn-primary', type: 'submit', name: 'commit', value: name }
end
|
#label_options ⇒ Object
21
22
23
|
# File 'app/models/effective/form_inputs/submit.rb', line 21
def label_options
false
end
|
#wrapper_options ⇒ Object
9
10
11
12
13
14
15
|
# File 'app/models/effective/form_inputs/submit.rb', line 9
def wrapper_options
if layout == :horizontal
{ class: 'form-group row form-actions'}
else
{ class: 'form-group form-actions'}
end
end
|