sweet-alert2-rails
sweet-alert2-rails copied to clipboard
ActionView::Template::Error (no implicit conversion of Symbol into Integer): for Buttons with Blocks
Hi, I'm also now getting this same error as question #5 and probably #10. I didn't want to comment on issue #10 as I'm not sure if he's having the same issue nor did I want to comment on a closed issue.
The error is:
ActionView::Template::Error (no implicit conversion of Symbol into Integer):
Using the Code:
<%= f.button(type: "submit", class: "btn btn-primary btn-outline p-sm text-center w-150") do %>
<i class="fa fa-bank fa-2x"></i>
<h3 class="font-normal">Legal Pending</h3>
<% end %>
According to #5 it was resolved but I am still getting this error using Rails 5.0.2, jQuery 3.1.1, and jQuery_ujs. I've tried putting the calls in to sweet alert js files within application.js
before jquery and jquery_ujs but no luck. I've confirmed that if I remove this gem then the button block works fine.
The usage for the button doesn't need to be f.button do
but it does need to be a button with a block, so if there is something else I can change it to that I'm unaware of but known to work with your gem then I'm okay with that too.
Thanks!
I've since replaced the button block above with button_to
to produce the desired results. So I'm fine on that front, however, the gem doesn't seem to work with button_to .. data: { confirm: .. }
, only link_to .. data: { confirm: ..}
.
same problem here!