Skip to content

Commit 8fd9c7c

Browse files
committed
Add js-routes
1 parent 4e4492b commit 8fd9c7c

File tree

7 files changed

+1462
-0
lines changed

7 files changed

+1462
-0
lines changed

Gemfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ gem "inertia_rails", "~> 3.10"
4646
# we leave gem here to watch for security updates
4747
gem "authentication-zero"
4848

49+
# Brings Rails named routes to javascript
50+
gem "js-routes"
51+
4952
group :development, :test do
5053
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
5154
gem "debug", platforms: %i[ mri windows ], require: "debug/prelude"

Gemfile.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,9 @@ GEM
134134
jbuilder (2.13.0)
135135
actionview (>= 5.0.0)
136136
activesupport (>= 5.0.0)
137+
js-routes (2.3.5)
138+
railties (>= 5)
139+
sorbet-runtime
137140
json (2.13.2)
138141
kamal (2.7.0)
139142
activesupport (>= 7.0)
@@ -331,6 +334,7 @@ GEM
331334
fugit (~> 1.11.0)
332335
railties (>= 7.1)
333336
thor (>= 1.3.1)
337+
sorbet-runtime (0.5.12368)
334338
sqlite3 (2.7.3-aarch64-linux-gnu)
335339
sqlite3 (2.7.3-aarch64-linux-musl)
336340
sqlite3 (2.7.3-arm-linux-gnu)
@@ -403,6 +407,7 @@ DEPENDENCIES
403407
factory_bot_rails
404408
inertia_rails (~> 3.10)
405409
jbuilder
410+
js-routes
406411
kamal
407412
propshaft
408413
puma (>= 5.0)

Rakefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,13 @@
66
require_relative "config/application"
77

88
Rails.application.load_tasks
9+
10+
if Rails.env.local?
11+
require "rubocop/rake_task"
12+
RuboCop::RakeTask.new
13+
14+
task default: %i[rubocop:autocorrect]
15+
end
16+
17+
# Update js-routes file before javascript build
18+
task "assets:precompile" => "js:routes"

0 commit comments

Comments
 (0)