From 411571c0dad9c80a26a5755e015ccad4dad8a8e9 Mon Sep 17 00:00:00 2001 From: Benjamin Randolph Date: Thu, 7 Nov 2024 07:55:54 -0700 Subject: [PATCH] Income to render with turbo. --- app/controllers/incomes_controller.rb | 5 +++++ app/views/components/_toolbar.html.erb | 4 +++- app/views/incomes/_dashboard.html.erb | 3 +++ app/views/incomes/index.turbo_stream.erb | 2 ++ 4 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 app/views/incomes/_dashboard.html.erb create mode 100644 app/views/incomes/index.turbo_stream.erb diff --git a/app/controllers/incomes_controller.rb b/app/controllers/incomes_controller.rb index def3700..2112628 100644 --- a/app/controllers/incomes_controller.rb +++ b/app/controllers/incomes_controller.rb @@ -10,6 +10,11 @@ class IncomesController < ApplicationController # GET /incomes or /incomes.json def index @incomes = Income.all + + respond_to do |format| + format.html + format.turbo_stream + end end # GET /incomes/1 or /incomes/1.json diff --git a/app/views/components/_toolbar.html.erb b/app/views/components/_toolbar.html.erb index 0b2be74..712a41f 100644 --- a/app/views/components/_toolbar.html.erb +++ b/app/views/components/_toolbar.html.erb @@ -1,3 +1,5 @@ +<%# locals: (active_tab:) %> + <%= turbo_frame_tag "dashboard_toolbar" do %>