dockyard/dismissible_helpers — pull request #18 by bitgangsta (2013-10-03 00:54:02+00:00)
Title: Removing dependency on jquery-ujs

Presently, you use `$.rails.ajax` as most rails instances have a CSRF token. And rails's ujs helpers behaviors automatically adds the CSRF if you use `$rails.ajax`.

However, some rails projects don't use `jquery-ujs` and instead favor other gems such as [rails-behaviors](https://github.com/josh/rails-behaviors/). Rails behaviors automatically adds the CSRF token to every jquery ajax request (see the [csrf.coffee](https://github.com/josh/rails-behaviors/blob/master/csrf.coffee) file in their repo).

As a result, this simple change fixes `dismissible_helpers` for me, and lets me use it with `rails-behaviors`. I suggest you detect if `$.rails` is present, as I have done, and if not default to the jquery `ajax` method.

Let me know what your thoughts are!