% # formstrap/media # # ==== Required parameters # * +attribute+ - Name of the attribute of the form model # * +form+ - Form object # # ==== Optional parameters # * +destroy+ - Adds delete buttons to the preview thumbnails # * +hint+ - Informative text to assist with data input. HTML markup is allowed # * +label+ - Text to display inside label tag. Defaults to the attribute name. Set to false if you don"t want to show a label # * +min+ - Limit the selection to a minimum amount of items # * +max+ - Limit the selection to a maximum amount of items # * +sort+ - Allow sorting by dragging items. `active_storage_attachments` must have a position column # * +wrapper+ - Hash with all options for the surrounding html tag # * +width+ - Width of the thumbnail # * +height+ - Height of the thumbnail # # ==== References # https://headmin.dev/docs/forms/media # # ==== Examples # Basic version # <%= form_with do |form| %#> # <%= render "formstrap/media", form: form, attribute: :file %#> # <% end %#> media = Formstrap::MediaView.new(local_assigns) %> <%= render "formstrap/wrapper", media.wrapper_options do %> <%= render "formstrap/label", media.label_options if media.prepend_label? %>