Class: ApplicationController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
app/controllers/application_controller.rb

Instance Method Summary collapse

Instance Method Details

#add_breadcrumb(name, path = nil) ⇒ Object



30
31
32
# File 'app/controllers/application_controller.rb', line 30

def add_breadcrumb(name, path = nil)
  breadcrumbs << Breadcrumb.new(name, path)
end

#after_sign_in_path_for(_resource) ⇒ Object



17
18
19
20
# File 'app/controllers/application_controller.rb', line 17

def (_resource)
  mediaflux_passthru_path
  # "/users/#{@user.id}"
end


26
27
28
# File 'app/controllers/application_controller.rb', line 26

def breadcrumbs
  @breadcrumbs ||= []
end

#new_session_path(_scope) ⇒ Object



13
14
15
# File 'app/controllers/application_controller.rb', line 13

def new_session_path(_scope)
  new_user_session_path
end

#render_not_foundObject

Render a 404 page for any undefined route



35
36
37
# File 'app/controllers/application_controller.rb', line 35

def render_not_found
  render file: Rails.public_path.join("404.html").to_s, layout: false, status: :not_found
end

#require_admin_userObject



22
23
24
# File 'app/controllers/application_controller.rb', line 22

def require_admin_user
  head :forbidden unless current_user&.eligible_sysadmin?
end