class HomeController < ApplicationController def index @db_status = check_database @timestamp = Time.current end def health render json: { status: "ok", database: check_database, timestamp: Time.current } end private def check_database ActiveRecord::Base.connection.execute("SELECT 1") "connected" rescue => e "error: #{e.message}" end end