Skip to content

Commit 844837f

Browse files
committed
Update reademe
1 parent ad2ae9e commit 844837f

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

README.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Request.JS for Rails
2+
3+
[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

Comments
 (0)