Module: InspectorDragit::ViewHelpers

Defined in:
lib/inspector_dragit/view_helpers.rb

Instance Method Summary collapse

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, content_or_options_with_block = 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

  (name, content_or_options_with_block, 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, content_or_options_with_block = 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 (name, content_or_options_with_block, opts, escape, &block)
end

#isp_dragit_draggable_classObject



3
4
5
# File 'lib/inspector_dragit/view_helpers.rb', line 3

def isp_dragit_draggable_class
  "inspector_dragit_draggable"
end

#isp_dragit_inspector_classObject



7
8
9
# File 'lib/inspector_dragit/view_helpers.rb', line 7

def isp_dragit_inspector_class
  "inspector_dragit_inspector"
end