Module: GOVUKDesignSystemFormBuilder::Builder
- Included in:
- Koi::FormBuilder
- Defined in:
- lib/govuk_design_system_formbuilder/elements/image.rb,
lib/govuk_design_system_formbuilder/elements/document.rb
Instance Method Summary collapse
-
#govuk_document_field(attribute_name, label: {}, caption: {}, hint: {}, form_group: {}, mime_types: Koi.config.document_mime_types, **kwargs, &block) ⇒ Object
Generates a
div
element with aninput
with type=file with a label, optional hint. -
#govuk_image_field(attribute_name, label: {}, caption: {}, hint: {}, form_group: {}, mime_types: Koi.config.image_mime_types, **kwargs, &block) ⇒ ActiveSupport::SafeBuffer
Generates a
div
element to preview uploaded images and aninput
with type=file with a label, optional hint.
Instance Method Details
#govuk_document_field(attribute_name, label: {}, caption: {}, hint: {}, form_group: {}, mime_types: Koi.config.document_mime_types, **kwargs, &block) ⇒ Object
Generates a div
element with an input
with type=file with a label, optional hint.
56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/govuk_design_system_formbuilder/elements/document.rb', line 56 def govuk_document_field(attribute_name, label: {}, caption: {}, hint: {}, form_group: {}, mime_types: Koi.config.document_mime_types, **kwargs, &block) Elements::Document.new( self, object_name, attribute_name, label:, caption:, hint:, form_group:, mime_types:, **kwargs, &block ).html end |
#govuk_image_field(attribute_name, label: {}, caption: {}, hint: {}, form_group: {}, mime_types: Koi.config.image_mime_types, **kwargs, &block) ⇒ ActiveSupport::SafeBuffer
Generates a div
element to preview uploaded images and an input
with type=file with a label, optional hint.
86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/govuk_design_system_formbuilder/elements/image.rb', line 86 def govuk_image_field(attribute_name, label: {}, caption: {}, hint: {}, form_group: {}, mime_types: Koi.config.image_mime_types, **kwargs, &block) Elements::Image.new( self, object_name, attribute_name, label:, caption:, hint:, form_group:, mime_types:, **kwargs, &block ).html end |