Skip to content

Commit

Permalink
Merge pull request rails#44406 from p8/guides/working-with-js-fix-exa…
Browse files Browse the repository at this point in the history
…mple

Fix javascript example code block [ci-skip]
  • Loading branch information
jonathanhefner committed Feb 11, 2022
2 parents d9a3866 + 0657327 commit 97d5716
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion guides/source/working_with_javascript_in_rails.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ $ bin/importmap pin react react-dom
```

Then, import the package into `application.js` as usual:

```javascript
import React from "react"
import ReactDOM from "react-dom"
Expand All @@ -57,7 +58,8 @@ bundling, you can create new Rails applications with your choice of

To use a bundler instead of import maps in a new Rails application, pass the `—javascript` or `-j`
option to `rails new`:
```

```bash
$ rails new my_new_app --javascript=webpack
OR
$ rails new my_new_app -j webpack
Expand Down

0 comments on commit 97d5716

Please sign in to comment.