Skip to content

Instantly share code, notes, and snippets.

View chris-gooley's full-sized avatar

Chris Gooley chris-gooley

  • Good Dog Design
  • Adelaide, Australia
View GitHub Profile
@chris-gooley
chris-gooley / _materializecss-rails-confirm.coffee
Last active May 1, 2018 12:55 — forked from dannyvassallo/_materializecss-rails-confirm.coffee
Replace Rails 4 confirmation/prompts with a toast message from Dogfalo Materialize CSS. Regular repo - https://github.com/Dogfalo/materialize Sass Gem - https://github.com/mkhairi/materialize-sass Website - http://materializecss.com/
$ ->
$.rails.allowAction = (link) ->
return true unless link.attr("data-confirm")
$.rails.showConfirmDialog link
false
$.rails.confirmed = (link) ->
link.removeAttr "data-confirm"
link[0].click() # force click on element directly