Class: Jav::HomeController

Inherits:
ApplicationController show all
Defined in:
app/controllers/jav/home_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#_current_user, #check_jav_license, #context, #exception_logger, #init_app

Methods included from Concerns::Breadcrumbs

#add_breadcrumb, #jav_breadcrumbs

Methods included from UrlHelpers

#edit_resource_path, #new_resource_path, #related_resources_path, #resource_attach_path, #resource_detach_path, #resource_path, #resource_view_path, #resources_path

Methods included from ApplicationHelper

#a_button, #a_link, #button_classes, #decode_filter_params, #empty_state, #encode_filter_params, #frame_id, #get_model_class, #input_classes, #mount_path, #render_license_warning, #render_license_warnings, #root_path_without_url, #svg, #white_panel_classes

Instance Method Details

#failed_to_loadObject



22
# File 'app/controllers/jav/home_controller.rb', line 22

def failed_to_load; end

#indexObject



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

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

    redirect_to computed_path
  elsif !Rails.env.development?
    @page_title = "Get started"
    resource = Jav::App.resources.min_by(&:model_key)
    redirect_to resources_path(resource: resource)
  end
end