Initial Rails test app

This commit is contained in:
Min Zeya Phyo
2026-01-15 12:26:30 +06:30
commit 1733430341
19 changed files with 418 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
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