Skip to content

Commit

Permalink
Update Readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
bogdan authored Oct 7, 2024
1 parent 0fb766b commit 87f8955
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -468,15 +468,13 @@ console.log(routes.inbox_path); // OK, only `inbox_path` is included in the bund
console.log(Object.keys(routes)); // forces bundler to include all exports, breaking tree shaking
```

### Exclude option
### Exclude/Include options

Split your routes into multiple files related to each section of your website like:

``` javascript
// admin-routes.js.erb
<%= JsRoutes.generate(include: /^admin_/) %>
// app-routes.js.erb
<%= JsRoutes.generate(exclude: /^admin_/) %>
``` ruby
JsRoutes.generate!('app/javascript/admin-routes.js', include: /^admin_/) %>
JsRoutes.generate!('app/javascript/app-routes.js', exclude: /^admin_/) %>
```

## Advantages over alternatives
Expand Down

0 comments on commit 87f8955

Please sign in to comment.