Class: AssetBox

Inherits:
Object
  • Object
show all
Defined in:
lib/inputs/asset_box.rb

Instance Method Summary collapse

Constructor Details

#initialize(object, object_name, template, method, opts) ⇒ AssetBox

Returns a new instance of AssetBox.



4
5
6
7
8
9
# File 'lib/inputs/asset_box.rb', line 4

def initialize(object, object_name, template, method, opts)
  @object = object
  @object_name = object_name
  @template = template
  @options = initialize_options(method, opts)
end

Instance Method Details

#to_htmlObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/inputs/asset_box.rb', line 11

def to_html
  output = ''
  output += header_html

  if @options[:uploader] == :top
    output += uploader_html
    output += attachments_html
    output += dialog_html if @options[:dialog]
  else
    output += attachments_html
    output += dialog_html if @options[:dialog]
    output += uploader_html if @options[:uploader]
  end

  output += footer_html

  output.html_safe
end