File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -126,7 +126,10 @@ class << self
126126 autoload :Testing , "graphql/testing"
127127 autoload :Current , "graphql/current"
128128 if defined? ( ::Rails ::Engine )
129- autoload :Dashboard , 'graphql/dashboard'
129+ # This needs to be defined before Rails runs `add_routing_paths`,
130+ # otherwise GraphQL::Dashboard's routes won't have been gathered for loading
131+ # when that initializer runs.
132+ require 'graphql/dashboard'
130133 end
131134end
132135
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ module Graphql
3434 class Dashboard < Rails ::Engine
3535 engine_name "graphql_dashboard"
3636 isolate_namespace ( Graphql ::Dashboard )
37- routes . draw do
37+ routes do
3838 root "landings#show"
3939 resources :statics , only : :show , constraints : { id : /[0-9A-Za-z\- .]+/ }
4040
@@ -76,6 +76,8 @@ class Dashboard < Rails::Engine
7676 resources :subscriptions , only : [ :show ] , constraints : { id : /[a-zA-Z0-9\- ]+/ }
7777 post "/subscriptions/clear_all" , to : "subscriptions#clear_all" , as : :clear_all
7878 end
79+
80+ ApplicationController . include ( Dashboard . routes . url_helpers )
7981 end
8082
8183 class ApplicationController < ActionController ::Base
You can’t perform that action at this time.
0 commit comments