Skip to content

Commit

Permalink
Merge pull request #497 from searls/patch-1
Browse files Browse the repository at this point in the history
Add Rails 5.1 / webpacker instructions
  • Loading branch information
rafaelfranca authored Aug 11, 2017
2 parents 4849eca + fcd8a33 commit 4b6e30f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,21 @@ Installation using npm.

Run `npm install --save jquery-ujs` to install the jquery-ujs package.

Installation using Rails and Webpacker
------------

If you're using [webpacker](https://github.com/rails/webpacker) (introduced in [Rails 5.1](http://edgeguides.rubyonrails.org/5_1_release_notes.html#optional-webpack-support)) to manage JavaScript assets, then you can add the jquery-ujs npm package to your project using the [yarn](https://yarnpkg.com/en/) CLI.

```
$ yarn add jquery-ujs
```

Then, from any of your included files (e.g. `app/javascript/packs/application.js`, or from a JavaScript file imported by such a pack), you need only import the package for jquery-ujs to be initialized:

```js
import {} from 'jquery-ujs'
```

Installation using Bower
------------

Expand Down

0 comments on commit 4b6e30f

Please sign in to comment.