mois3x / sweet-alert-rails-confirm

A Rails confirm replacement with SweetAlert
MIT License
73 stars 50 forks source link

html safe text doesn't work #37

Closed moayman closed 8 years ago

moayman commented 8 years ago
swal({   
            html: true,
            title: "Register in this course?",   
            text: "<ul style='text-align: left;'><li>You can only unregister by contacting the admins</li><li>You will be able to rate the course by the end of the semester</li><li>You will be able to add/remove Professors and Teaching Assistants</li><li>You will be notified with any changes within the course</li><li>You can register in 10 courses per semester only</li></ul>",
            type: "info",   
            showCancelButton: true,   
            confirmButtonColor: "#5cb85c",
            confirmButtonText: "Register"
        })

I can set all the options like that swal js call. but not the html: true it just doesn't work. why is that?

That's my erb code

<%= link_to "Register in this course", register_semester_course_path(@semester_course), method: :post, data: { 'html': true, confirm: 'Register in this course?', text: "<ul style='text-align: left;'><li>You can only unregister by contacting the admins</li><li>You will be able to rate the course by the end of the semester</li><li>You will be able to add/remove Professors and Teaching Assistants</li><li>You will be notified with any changes within the course</li><li>You can register in 10 courses per semester only</li></ul>",  'confirm-button-text': 'Register', 'confirm-button-color': '#5cb85c', 'sweet-alert-type': 'info' }, class: "btn btn-success" %>
moayman commented 8 years ago

Fixed by updating gem from 0.4.0 to 0.4.1