Class: DataPact::ApplicationController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- DataPact::ApplicationController
show all
- Defined in:
- app/controllers/data_pact/application_controller.rb
Instance Method Summary
collapse
Instance Method Details
#index ⇒ Object
4
5
6
|
# File 'app/controllers/data_pact/application_controller.rb', line 4
def index
redirect_to routes_path
end
|
#jobs ⇒ Object
33
34
35
36
37
38
|
# File 'app/controllers/data_pact/application_controller.rb', line 33
def jobs
@jobs = Sidekiq::Queue.all.flat_map(&:to_a).sort_by(&:enqueued_at)
@redis = true
rescue Redis::CannotConnectError => e
@redis = false
end
|
#routes ⇒ Object
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'app/controllers/data_pact/application_controller.rb', line 8
def routes
@routes = Rails.application.routes.routes.map do |route|
{
name: route.name,
verb: route.verb,
path: route.path.spec.to_s,
format: route.defaults[:format],
controller: route.defaults[:controller],
action: route.defaults[:action]
}
end
respond_to do |format|
format.html
format.json do
render json: {
partial: render_to_string(partial: 'data_pact/routes/list', formats: [:html]),
}
end
end
end
|
#settings ⇒ Object
30
31
|
# File 'app/controllers/data_pact/application_controller.rb', line 30
def settings
end
|