Module: Voltron::Upload::Field
- Includes:
- ActionView::Helpers::TagHelper
- Defined in:
- lib/voltron/upload/action_view/field.rb
Defined Under Namespace
Classes: UploadField
Instance Method Summary collapse
Instance Method Details
#file_field(method, options = {}) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/voltron/upload/action_view/field.rb', line 7 def file_field(method, ={}) if Voltron.config.upload.enabled && ![:default] template = instance_variable_get('@template') field = UploadField.new(@object, method, template, ) # +merge+ is because options is a hash with_indifferent_access, and will therefore have an 'object' attribute when converted to html #super method, {}.merge(field.options) content_tag 'v-upload', nil, field. else .delete(:default) super method, end end |