Class: SolidQueueMonitor::ApplicationController

Inherits:
ActionController::Base
  • Object
show all
Includes:
ActionController::Flash, ActionController::HttpAuthentication::Basic::ControllerMethods
Defined in:
app/controllers/solid_queue_monitor/application_controller.rb

Direct Known Subclasses

BaseController

Instance Method Summary collapse

Instance Method Details

#set_flash_message(message, type) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'app/controllers/solid_queue_monitor/application_controller.rb', line 12

def set_flash_message(message, type)
  # Store in instance variable for access in views
  @flash_message = message
  @flash_type = type

  # Try to use Rails flash if available
  begin
    flash[:notice] = message if type == :success
    flash[:alert] = message if type == :error
  rescue StandardError
    # Flash not available (e.g., no session middleware)
  end
end