Class: Jobshop::Builder

Inherits:
ActionView::Helpers::FormBuilder
  • Object
show all
Defined in:
app/builders/jobshop/builder.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#button(value = nil, *args) ⇒ Object



37
38
39
40
41
42
# File 'app/builders/jobshop/builder.rb', line 37

def button(value = nil, *args)
  button_classes = [ "mdl-button", "mdl-js-button", "mdl-button--raised",
    "mdl-button--colored", "mdl-js-ripple-effect" ]

  super(value, class: button_classes)
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.(:span, field.to_s.humanize, class: [ "mdl-checkbox__label" ])
    content.html_safe
  end
  output.html_safe
end

#errors_on?(attribute) ⇒ Boolean

Returns:

  • (Boolean)


44
45
46
# File 'app/builders/jobshop/builder.rb', line 44

def errors_on?(attribute)
  @object.errors[attribute].present?
end