Class: DeletableAttachmentInput
- Inherits:
-
SimpleForm::Inputs::FileInput
- Object
- SimpleForm::Inputs::FileInput
- DeletableAttachmentInput
- Defined in:
- app/inputs/deletable_attachment_input.rb
Instance Method Summary collapse
Instance Method Details
#input(wrapper_options) ⇒ Object
2 3 4 5 6 7 8 9 10 |
# File 'app/inputs/deletable_attachment_input.rb', line 2 def input() = (, ) out = '' out << @builder.file_field(attribute_name, ) if object.send("#{attribute_name}?") out << @builder.input("delete_#{attribute_name}", as: :boolean, label: "Remove?", wrapper_html: { class: 'deletable_attachment_input' }) end out.html_safe end |