Module: InspectorDragit::ViewHelpers
- Defined in:
- lib/inspector_dragit/view_helpers.rb
Instance Method Summary collapse
- #go_go_dragit_draggable_content(name, record, content_or_options_with_block = nil, opts = nil, escape = true, &block) ⇒ Object
- #go_go_dragit_inspector_content(name = :div, content_or_options_with_block = nil, opts = nil, escape = true, &block) ⇒ Object
- #isp_dragit_draggable_class ⇒ Object
- #isp_dragit_inspector_class ⇒ Object
Instance Method Details
#go_go_dragit_draggable_content(name, record, content_or_options_with_block = nil, opts = nil, escape = true, &block) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/inspector_dragit/view_helpers.rb', line 11 def go_go_dragit_draggable_content(name, record, = nil, opts = nil, escape = true, &block) opts = {} if opts.nil? opts[:data] = {} if opts[:data].nil? opts[:data][:inspector_dragit] = record.inspector_dragit_data.to_json if opts[:class].blank? opts[:class] = isp_dragit_draggable_class else opts[:class] << " " << isp_dragit_draggable_class end content_tag(name, , opts, escape, &block) end |
#go_go_dragit_inspector_content(name = :div, content_or_options_with_block = nil, opts = nil, escape = true, &block) ⇒ Object
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/inspector_dragit/view_helpers.rb', line 25 def go_go_dragit_inspector_content(name=:div, = nil, opts = nil, escape = true, &block) opts = {} if opts.nil? if opts[:class].blank? opts[:class] = isp_dragit_inspector_class else opts[:class] << " " << isp_dragit_inspector_class end return content_tag(name, , opts, escape, &block) end |
#isp_dragit_draggable_class ⇒ Object
3 4 5 |
# File 'lib/inspector_dragit/view_helpers.rb', line 3 def isp_dragit_draggable_class "inspector_dragit_draggable" end |
#isp_dragit_inspector_class ⇒ Object
7 8 9 |
# File 'lib/inspector_dragit/view_helpers.rb', line 7 def isp_dragit_inspector_class "inspector_dragit_inspector" end |