Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/noredink/elm-rails
Convenience functions for using Elm with Rails.
https://github.com/noredink/elm-rails
Last synced: about 2 months ago
JSON representation
Convenience functions for using Elm with Rails.
- Host: GitHub
- URL: https://github.com/noredink/elm-rails
- Owner: NoRedInk
- License: bsd-3-clause
- Created: 2015-09-09T11:35:43.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2022-03-24T18:40:42.000Z (almost 3 years ago)
- Last Synced: 2024-05-08T23:25:04.410Z (8 months ago)
- Language: Elm
- Homepage: https://package.elm-lang.org/packages/NoRedInk/elm-rails/latest
- Size: 97.7 KB
- Stars: 105
- Watchers: 27
- Forks: 15
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Convenience functions for working with Elm in Rails
If you see lots of `401` responses on requests other than `GET` requests, it's likely because `elm-rails` doesn't know about the CSRF token Rails includes in the header in a `` tag. For a drop-in fix, include [`csrf-xhr`](https://www.npmjs.com/package/csrf-xhr) on all pages which use `elm-rails`. (Alternatively, you can pass the token into your Elm program through a flag, store it in your `Model`, and add the header to all requests manually. Needless to say, including [`csrf-xhr`](https://www.npmjs.com/package/csrf-xhr) on the page is much easier!)
As of Elm 0.19 this package is just maintained so that calls in existing code don't need to
change. New projects should use the standard `elm/http` library
and manage the csrf header through one of the methods described above.---
[![NoRedInk](https://cloud.githubusercontent.com/assets/1094080/9069346/99522418-3a9d-11e5-8175-1c2bfd7a2ffe.png)](http://noredink.com/about/team)