From 87f8955180729c47a9b32b0785bd121b8e6d5299 Mon Sep 17 00:00:00 2001 From: Bogdan Gusiev Date: Mon, 7 Oct 2024 21:46:43 +0200 Subject: [PATCH] Update Readme.md --- Readme.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Readme.md b/Readme.md index 710643c..c346811 100644 --- a/Readme.md +++ b/Readme.md @@ -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