easy_connect 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 654a6e1e269bb504f49b7210387623291db8c164b6dd1a1eff76f865577619e7
4
- data.tar.gz: ecbc1fe761242d120982dbd0237c086b78d8bc4bb78db038bbfacea17954da24
3
+ metadata.gz: 7441e1fb82023a6b75880cf424fcea791bf3f85d05db516f92cc1fd698a8420b
4
+ data.tar.gz: f3a9682e3505c55703e0800ccc89e9566c9b41b585d0c4d136e7c7886da4a72e
5
5
  SHA512:
6
- metadata.gz: 0eb5312966d53e0d8125b33d152c24a9a1e14c6f162c907ec5cf116a5e2e8eef86f7ac4eb5505d4d799ce8149c6d3536dbd6d557efb3b61022050de175c22cd5
7
- data.tar.gz: 1a5b739bcbc85ec4ed1a015085d414f4a1bcbf6aff73f11952eb54af080a4c0010483d5c6ff4123f58c06cbe51919158eaf812111cc5dccb7f12d9ca6ada159f
6
+ metadata.gz: a35c0aacdfe8b4a0a41b19e83b53d22cf888864ff7e9d66b79e34658eaa04a3526328f97ade795e2cb8cc242057a4af7b3951fd023607a2af861bedcef9655e3
7
+ data.tar.gz: 7be23230f6376b46280437b04a51f381ce663d95ba1d15a20811c8f1c9f4b2e17cf8cccb303c7d90f2a95dd236214757516442549e5598530fd048310441ae24
@@ -9,10 +9,21 @@ module EasyConnect
9
9
  layout -> { connect_host.admin_layout }
10
10
 
11
11
  helper KeystoneUi::React::MountHelper
12
+ helper AppRoutesHelper
13
+
14
+ before_action { AppRoutesHelper.define_app_route_helpers }
15
+
16
+ helper_method :connect_routes
12
17
 
13
18
  rescue_from Refused do |refusal|
14
19
  render json: { error: refusal.message }, status: :unprocessable_entity
15
20
  end
21
+
22
+ private
23
+
24
+ def connect_routes
25
+ @connect_routes ||= ActionDispatch::Routing::RoutesProxy.new(_routes, self, _routes.url_helpers)
26
+ end
16
27
  end
17
28
  end
18
29
  end
@@ -0,0 +1,12 @@
1
+ module EasyConnect
2
+ module AppRoutesHelper
3
+ def self.define_app_route_helpers
4
+ @app_route_helpers_defined ||= begin
5
+ (Rails.application.routes.named_routes.helper_names - EasyConnect::Engine.routes.named_routes.helper_names).each do |name|
6
+ define_method(name) { |*args, **options| main_app.public_send(name, *args, **options) }
7
+ end
8
+ true
9
+ end
10
+ end
11
+ end
12
+ end
@@ -5,4 +5,4 @@
5
5
 
6
6
  <h1><%= @board.title %></h1>
7
7
 
8
- <%= react_ui("easy_connect/board", { base: manage_board_path(@board), token: form_authenticity_token, initial: @board.drawing }) %>
8
+ <%= react_ui("easy_connect/board", { base: connect_routes.manage_board_path(@board), token: form_authenticity_token, initial: @board.drawing }) %>
@@ -1,3 +1,3 @@
1
1
  module EasyConnect
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy_connect
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - tylercschneider
@@ -56,6 +56,7 @@ files:
56
56
  - app/controllers/easy_connect/manage/items_controller.rb
57
57
  - app/controllers/easy_connect/manage/lines_controller.rb
58
58
  - app/controllers/easy_connect/manage/saves_controller.rb
59
+ - app/helpers/easy_connect/app_routes_helper.rb
59
60
  - app/javascript/easy_connect/board.jsx
60
61
  - app/javascript/easy_connect/board/Board.jsx
61
62
  - app/javascript/easy_connect/board/lines.js