You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Rails Request.JS](https://github.com/rails/request.js) encapsulates the logic to send by default some headers that are required by rails applications like the `X-CSRF-Token`.
4
+
5
+
## Installation
6
+
7
+
1. Add the `requestjs-rails` gem to your Gemfile: `gem 'requestjs-rails'`
8
+
2. Run `./bin/bundle install`.
9
+
3. Run `./bin/rails requestjs:install`
10
+
11
+
If using the asset pipeline to manage JavaScript, the last command will:
12
+
13
+
- Append import "@rails/request.js" to your app/assets/javascripts/application.js entrypoint.
14
+
15
+
Make sure you've already installed `importmap-rails` and that it's referenced before `requestjs-rails` in your Gemfile.
16
+
17
+
If using Webpacker to manage JavaScript, the last command will:
18
+
19
+
- Install the Request.JS NPM package.
20
+
21
+
## Usage
22
+
23
+
With the installation done check the documentation in the [Rails Request.JS](https://github.com/rails/request.js#how-to-use) repository.
24
+
25
+
## License
26
+
27
+
Request.JS for Rails is released under the [MIT License](https://opensource.org/licenses/MIT).
0 commit comments