A Rails confirm replacement with SweetAlert
depends on http://github.com/Najtmare/sweet-alert-rails
Install: gem 'sweet-alert-confirm'
Rails >= 3.1
application.js:
//= require sweet-alert-confirm
application.css:
/*
*= require sweet-alert
*/
You can pass options in data:
data: {
confirm: 'Are you ready?'
:'confirm-button-text' => 'Im ready',
:'cancel-button-text' => 'No way',
:'confirm-button-color' => '#66CD00',
type: 'info',
text: 'This is a subtitle',
:'image-url' => '/pic.png'
}