Module: Workbench::FormHelper
- Defined in:
- app/helpers/workbench/form_helper.rb
Instance Method Summary collapse
- #destroy_related_link(f, text: 'x') ⇒ Object
-
#lock_tag(locks, object_name, method, klass = 'lock') ⇒ html
A check box and label, styled as SVG icons.
Instance Method Details
#destroy_related_link(f, text: 'x') ⇒ Object
3 4 5 |
# File 'app/helpers/workbench/form_helper.rb', line 3 def (f, text: 'x') content_tag(:span, text, class: 'destroyable', 'data-object-name' => f.object_name) if !f.object.new_record? end |
#lock_tag(locks, object_name, method, klass = 'lock') ⇒ html
Returns a check box and label, styled as SVG icons.
11 12 13 14 15 16 17 18 |
# File 'app/helpers/workbench/form_helper.rb', line 11 def lock_tag( locks, object_name, method, klass = 'lock' ) locked = locks.locked?(object_name, method) name = "locks[#{object_name}][#{method}]" css = klass check_box_tag(name, '1', locked, class: :locked) + label_tag(name, '', class: css) end |