Class: Avo::ResourceOverviewController

Inherits:
ApplicationController show all
Defined in:
app/controllers/avo/resource_overview_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#exception_logger, #init_app

Instance Method Details

#indexObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'app/controllers/avo/resource_overview_controller.rb', line 5

def index
  resources = App.get_resources.map do |resource|
    {
      name: resource.name,
      url: resource.url,
      count: resource.model.count,
    }
  end

  render json: {
    resources: resources,
    hidden: Avo.configuration.hide_resource_overview_component,
    hide_docs: Avo.configuration.hide_documentation_link,
  }
end