Fix nil when no page
Some checks failed
/ Run tests (push) Failing after 1m7s
/ Run system tests (push) Failing after 1m16s
/ Build, push and deploy image (push) Has been skipped

This commit is contained in:
david 2024-11-01 03:31:57 +01:00
parent 42c077f6ab
commit 08f173f3da

View file

@ -20,8 +20,9 @@ p.small.mb-2
= link_to(page.path, report_path(@report, page_id: page.id), class: "nav-link#{@current_page&.id == page.id ? " active" : nil }", data: { "turbo-action": :advance }) = link_to(page.path, report_path(@report, page_id: page.id), class: "nav-link#{@current_page&.id == page.id ? " active" : nil }", data: { "turbo-action": :advance })
= turbo_frame_tag "new_page_frame" do = turbo_frame_tag "new_page_frame" do
= render partial: "reports/new_page_button", locals: { report: @report } = render partial: "reports/new_page_button", locals: { report: @report }
= turbo_frame_tag(dom_id(@current_page, :notes)) do - if @current_page
= render partial: "pages/notes", locals: { page: @current_page } = turbo_frame_tag(dom_id(@current_page, :notes)) do
= render partial: "pages/notes", locals: { page: @current_page }
.col-lg-9.col-md-6.col-sm-12 .col-lg-9.col-md-6.col-sm-12
- if @current_page - if @current_page
= render @current_page = render @current_page