% # formstrap/file # # ==== Required parameters # * +attribute+ - Name of the attribute of the form model # * +form+ - Form object # # ==== Optional parameters # * +append+ - Display as input group with text on the right-hand side # * +destroy+ - Adds delete buttons to the preview thumbnails # * +dropzone+ - Add drag&drop interface. This setting automatically enables previews # * +hint+ - Informative text to assist with data input. HTML markup is allowed. # * +multiple+ - Add drag&drop interface. This setting automatically enables previews # * +preview+ - Show file previews after selection and after upload # * +label+ - Text to display inside label tag. Defaults to the attribute name. Set to false if you don"t want to show a label. # * +prepend+ - Display as input group with text on the left-hand side # * +wrapper+ - Hash with all options for the surrounding html tag # # ==== References # https://headmin.dev/docs/forms/file # https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file # https://apidock.com/rails/ActionView/Helpers/FormHelper/file_field # # ==== Examples # Basic version # <%= form_with do |form| %#> # <%= render "formstrap/file", form: form, attribute: :file %#> # <% end %#> file = Formstrap::FileView.new(local_assigns) %> <%= render "formstrap/wrapper", file.wrapper_options do %> <%= render "formstrap/label", file.label_options if file.prepend_label? %>