Module: Progstr::Filer::FormHtml

Defined in:
lib/filer/views/form_html.rb

Instance Method Summary collapse

Instance Method Details

#filer_upload_field(method, options = {}) ⇒ Object



5
6
7
8
9
10
11
12
13
14
# File 'lib/filer/views/form_html.rb', line 5

def filer_upload_field(method, options = {})
  unless options.key? :file_input_name
    sanitized_method_name = method.to_s.sub(/\?$/,"")
    input_name = "#{@object_name}[#{sanitized_method_name}]"
    options[:file_input_name] = input_name
  end
  attachment = @object.send(method)

  @template.filer_upload(attachment, options)
end