Class: Wurk::DashboardController

Inherits:
ApplicationController show all
Defined in:
app/controllers/wurk/dashboard_controller.rb

Overview

Serves the SPA shell. Everything else is JSON from ApiController.

Production: returns the precompiled index.html shipped in vendor/assets/dashboard. The release pipeline (‘frontend:build` →`gem build`) writes both that file and the wurk-manifest.json validated at engine boot.

Development: when WURK_VITE_DEV=1 is set, fetches the shell from the Vite dev server (default :5173) so contributors get HMR without rebuilding the bundle on every change.

Constant Summary collapse

VITE_DEV_URL =
'http://localhost:5173/'
INDEX_REL_PATH =
['vendor', 'assets', 'dashboard', 'index.html'].freeze

Instance Method Summary collapse

Instance Method Details

#indexObject



21
22
23
# File 'app/controllers/wurk/dashboard_controller.rb', line 21

def index
  render layout: false, html: spa_html.html_safe
end