Class: CCS::Components::GovUK::Field::Input::FileUpload
- Inherits:
-
CCS::Components::GovUK::Field::Input
- Object
- Base
- CCS::Components::GovUK::Field
- CCS::Components::GovUK::Field::Input
- CCS::Components::GovUK::Field::Input::FileUpload
- Defined in:
- lib/ccs/components/govuk/field/input/file_upload.rb
Overview
GOV.UK File Upload
This is used for generating the file upload component from the GDS - Components - File Upload
Constant Summary collapse
- DEFAULT_ATTRIBUTES =
The default attributes for the file upload
{ class: 'govuk-file-upload' }.freeze
Instance Method Summary collapse
-
#render ⇒ ActiveSupport::SafeBuffer
Generates the HTML for the GOV.UK File Upload component.
Methods inherited from CCS::Components::GovUK::Field::Input
Methods inherited from CCS::Components::GovUK::Field
Methods inherited from Base
Constructor Details
This class inherits a constructor from CCS::Components::GovUK::Field::Input
Instance Method Details
#render ⇒ ActiveSupport::SafeBuffer
Generates the HTML for the GOV.UK File Upload component
22 23 24 25 26 27 28 29 30 |
# File 'lib/ccs/components/govuk/field/input/file_upload.rb', line 22 def render super do if [:form] [:form].file_field(attribute, **[:attributes]) else context.file_field_tag(attribute, **[:attributes]) end end end |