Class: Avo::HomeController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/avo/home_controller.rb

Instance Method Summary collapse

Instance Method Details

#failed_to_loadObject



20
21
# File 'app/controllers/avo/home_controller.rb', line 20

def failed_to_load
end

#indexObject



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

def index
  if Avo.configuration.home_path.present?
    # If the home_path is a block run it, if not, just use it
    computed_path = if Avo.configuration.home_path.respond_to? :call
      instance_exec(&Avo.configuration.home_path)
    else
      Avo.configuration.home_path
    end

    redirect_to computed_path
  elsif !Rails.env.development?
    @page_title = "Get started"
    resource = Avo.resource_manager.all.min_by { |resource| resource.model_key }
    redirect_to resources_path(resource: resource)
  end
end