mirror of
https://github.com/we-promise/sure.git
synced 2026-05-29 23:39:03 +00:00
feat(goals/new): standalone page render when not in a Turbo frame
Direct nav to /goals/new used to render the index page with an empty modal frame because the entire template was wrapped in DS::Dialog. The URL was effectively un-shareable. Branch on turbo_frame_request? — Turbo Frame requests still render the DS::Dialog wrapper (the existing in-modal flow on the index page keeps working). Non-frame requests render a standalone page-level header (h1 + subtitle + icon) followed by the form_stepper partial. Same Stimulus controller, same data-goal-stepper-modal-subtitle selector, so the stepper's subtitle update path works identically. Controller sets @breadcrumbs so the standalone variant gets the Home > Goals > New goal trail. Verified both paths via Playwright: direct GET renders standalone form with h1 "New goal" + no dialog; click-from-index opens the DS::Dialog with the stepper inside.
This commit is contained in:
@@ -45,6 +45,11 @@ class GoalsController < ApplicationController
|
||||
currency: Current.family.primary_currency_code
|
||||
)
|
||||
@linkable_accounts = linkable_accounts_for_new
|
||||
@breadcrumbs = [
|
||||
[ t("breadcrumbs.home"), root_path ],
|
||||
[ t("goals.index.title"), goals_path ],
|
||||
[ t("goals.new.heading"), nil ]
|
||||
]
|
||||
end
|
||||
|
||||
def create
|
||||
|
||||
Reference in New Issue
Block a user