Class: Jobshop::Builder
- Inherits:
-
ActionView::Helpers::FormBuilder
- Object
- ActionView::Helpers::FormBuilder
- Jobshop::Builder
- Defined in:
- app/builders/jobshop/builder.rb
Overview
:nodoc:
Instance Method Summary collapse
- #button(value = nil, *args) ⇒ Object
- #check_box(field, *args) ⇒ Object
- #errors_on?(attribute) ⇒ Boolean
Instance Method Details
#button(value = nil, *args) ⇒ Object
37 38 39 40 41 42 |
# File 'app/builders/jobshop/builder.rb', line 37 def (value = nil, *args) = [ "mdl-button", "mdl-js-button", "mdl-button--raised", "mdl-button--colored", "mdl-js-ripple-effect" ] super(value, class: ) end |
#check_box(field, *args) ⇒ Object
26 27 28 29 30 31 32 33 34 35 |
# File 'app/builders/jobshop/builder.rb', line 26 def check_box(field, *args) output = "" output += label(field, class: [ "mdl-checkbox", "mdl-js-checkbox", "mdl-js-ripple-effect" ]) do content = "" content += super(field, class: [ "mdl-checkbox__input" ]) content += @template.content_tag(:span, field.to_s.humanize, class: [ "mdl-checkbox__label" ]) content.html_safe end output.html_safe end |
#errors_on?(attribute) ⇒ Boolean
44 45 46 |
# File 'app/builders/jobshop/builder.rb', line 44 def errors_on?(attribute) @object.errors[attribute].present? end |