Class: Shimmer::Form::PdfField

Inherits:
Field
  • Object
show all
Defined in:
lib/shimmer/form/pdf_field.rb

Instance Attribute Summary

Attributes inherited from Field

#builder, #collection, #id_method, #method, #name_method, #options

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Field

#initialize, #prepare, #wrapper_options

Constructor Details

This class inherits a constructor from Shimmer::Form::Field

Class Method Details

.can_handle?(method) ⇒ Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/shimmer/form/pdf_field.rb', line 9

def can_handle?(method)
  method.to_s.end_with?("pdf")
end

Instance Method Details

#renderObject



14
15
16
# File 'lib/shimmer/form/pdf_field.rb', line 14

def render
  builder.file_field method, options.reverse_merge(accept: "application/pdf")
end