Sha256: 4118b19dcda94cafd3efd01295bd8db01e0ed15415128a73240b82f2972a460b
Contents?: true
Size: 1.03 KB
Versions: 6
Compression:
Stored size: 1.03 KB
Contents
/ Modal = form_tag labels_path, method: :post, id:'new-label-form', remote: true do .modal.fade{'aria-hidden' => 'true', 'aria-labelledby' => 'newLabelModalFormLabel', tabindex: '-1', id: 'newLabelModalForm'} .modal-dialog .modal-content .modal-header %h5#newLabelModalFormLabel.modal-title New label %button.btn-close{'aria-label' => 'Close', 'data-bs-dismiss' => 'modal', type: 'button'} .modal-body = text_field_tag :label_name, nil, placeholder: 'Label name', class: 'form-control' .modal-footer %button.btn.btn-secondary{'data-bs-dismiss' => 'modal', type: 'button'} Close %button.btn.btn-primary Create :javascript $(document).ready(function() { $('#new-label-form').on('ajax:success', function(event, response) { $('#newLabelModalForm').modal('hide'); $('#labels').html(response.updated_html); this.reset(); // Reset the form }).on('ajax:error', function(event, xhr, status, error) { alert(xhr.responseText); }); });
Version data entries
6 entries across 6 versions & 1 rubygems