[15-minute fix] Add js-routes gem (#15133)

* Add js-routes gem

* Update config/initializers/js_routes.rb

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Remove routes form base.jsx

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
This commit is contained in:
Michael Kohl 2021-11-01 10:08:15 +07:00 committed by GitHub
parent 1ffbb7aa0f
commit 1458b3ef56
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 0 deletions

View file

@ -52,6 +52,7 @@ gem "i18n-js", "~> 3.9.0" # Helps with internationalization in Rails.
gem "imgproxy", "~> 2.0" # A gem that easily generates imgproxy URLs for your images
gem "inline_svg", "~> 1.7" # Embed SVG documents in your Rails views and style them with CSS
gem "jbuilder", "~> 2.11" # Create JSON structures via a Builder-style DSL
gem "js-routes", "~> 2.1" # Brings Rails named routes to javascript
gem "jsonapi-serializer", "~> 2.2" # Serializer for Ruby objects
gem "kaminari", "~> 1.2" # A Scope & Engine based, clean, powerful, customizable and sophisticated paginator
gem "katex", "~> 0.8.0" # This rubygem enables you to render TeX math to HTML using KaTeX. It uses ExecJS under the hood

View file

@ -415,6 +415,8 @@ GEM
actionpack (>= 3.1)
railties (>= 3.1)
sass (>= 3.2)
js-routes (2.1.1)
railties (>= 4)
json (2.5.1)
jsonapi-serializer (2.2.0)
activesupport (>= 4.2)
@ -943,6 +945,7 @@ DEPENDENCIES
imgproxy (~> 2.0)
inline_svg (~> 1.7)
jbuilder (~> 2.11)
js-routes (~> 2.1)
jsonapi-serializer (~> 2.2)
kaminari (~> 1.2)
katex (~> 0.8.0)

View file

@ -0,0 +1 @@
<%= JsRoutes.generate %>

View file

@ -0,0 +1,6 @@
JsRoutes.setup do |c|
c.camel_case = true
# Setup your JS module system:
# ESM, CJS, AMD, UMD or nil
# c.module_type = "ESM"
end

BIN
vendor/cache/js-routes-2.1.1.gem vendored Normal file

Binary file not shown.