You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After selecting okay on sweet alert, I get following error in js console and request doesn't reach rails server.
Uncaught (in promise) TypeError: link.getAttribute is not a function
at Object.Rails.handleMethod (rails-ujs.self-....js:471)
at sweetAlertConfirmedCallback (sweet-alert2-rails.self-...js:37)
at <anonymous>
<%= form_for @project, method: :delete do |f| %>
<%= f.submit "Delete Project", class: "btn red accent-4", data: { confirm: 'Are you sure?',
'confirm-button-text': 'Do it!',
'cancel-button-text': 'Nah, not yet',
'confirm-button-color': '#3a96d1',
'sweet-alert-type': 'error',
text: 'You won\'t'} %>
<% end %>
There is an issue in sweetAlertConfirmedCallback() trying to reference data that hasn't been properly set.
Rails.handleMethod = function(e) {
var csrfParam, csrfToken, form, formContent, href, link, method;
link = this;
method = link.getAttribute('data-method'); // <----- This guy throws a fit.
...
After selecting okay on sweet alert, I get following error in js console and request doesn't reach rails server.
link_to code for reference:
The text was updated successfully, but these errors were encountered: