Class: CarrierWaveDirect::FormBuilder
- Inherits:
-
ActionView::Helpers::FormBuilder
- Object
- ActionView::Helpers::FormBuilder
- CarrierWaveDirect::FormBuilder
- Defined in:
- lib/carrierwave_direct/form_builder.rb
Instance Method Summary collapse
- #content_type_label(content = nil) ⇒ Object
- #content_type_select(choices = [], selected = nil, options = {}) ⇒ Object
- #fields_except_file_field(options = {}) ⇒ Object
- #file_field(method, options = {}) ⇒ Object
Instance Method Details
#content_type_label(content = nil) ⇒ Object
23 24 25 26 |
# File 'lib/carrierwave_direct/form_builder.rb', line 23 def content_type_label(content=nil) content ||= 'Content Type' @template.label_tag('Content-Type', content) end |
#content_type_select(choices = [], selected = nil, options = {}) ⇒ Object
28 29 30 |
# File 'lib/carrierwave_direct/form_builder.rb', line 28 def content_type_select(choices = [], selected = nil, = {}) @template.select_tag('Content-Type', (choices, selected), ) end |
#fields_except_file_field(options = {}) ⇒ Object
17 18 19 20 21 |
# File 'lib/carrierwave_direct/form_builder.rb', line 17 def fields_except_file_field( = {}) @object.policy(enforce_utf8: true) hidden_fields() end |
#file_field(method, options = {}) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/carrierwave_direct/form_builder.rb', line 5 def file_field(method, = {}) @object.policy(enforce_utf8: true) fields = hidden_fields() # The file field must be the last element in the form. # Any element after this will be ignored by Amazon. .merge!(:name => "file") fields << super end |