From 8d9b281607d8093fe74892f9f44bd3a9e45f570b Mon Sep 17 00:00:00 2001 From: Benjamin Randolph <104036158+neb417@users.noreply.github.com> Date: Thu, 7 Nov 2024 06:38:53 -0700 Subject: [PATCH] Add routes to toolbar tabs. (#56) * Add routes to toolbar links. * Move toolbar to application level. * Move toolbar to application level. * Route to index pages. --- app/controllers/incomes_controller.rb | 5 ----- app/views/components/_toolbar.html.erb | 7 ++----- app/views/dashboard/index.html.erb | 1 - app/views/layouts/application.html.erb | 1 + 4 files changed, 3 insertions(+), 11 deletions(-) diff --git a/app/controllers/incomes_controller.rb b/app/controllers/incomes_controller.rb index b9b27f7..def3700 100644 --- a/app/controllers/incomes_controller.rb +++ b/app/controllers/incomes_controller.rb @@ -10,11 +10,6 @@ class IncomesController < ApplicationController # GET /incomes or /incomes.json def index @incomes = Income.all - - respond_to do |format| - format.html { render :index } - format.json { render json: @incomes } - 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 c0d842d..0b2be74 100644 --- a/app/views/components/_toolbar.html.erb +++ b/app/views/components/_toolbar.html.erb @@ -7,13 +7,10 @@ <%= link_to "Federal Tax Brackets", federal_tax_brackets_path, data: { turbo_stream: true }, class: active_tab == :federal_tax_brackets ? "active-toolbar-tab" : "inactive-toolbar-tab" %>
  • - State Income Tax + <%= link_to "Incomes", incomes_path, data: { turbo: false }, class: active_tab == :incomes ? "active-toolbar-tab" : "inactive-toolbar-tab" %>
  • - Incomes -
  • -
  • - Fixed Expenses + <%= link_to "Fixed Expenses", fixed_expenses_path, data: { turbo: false }, class: active_tab == :fixed_expenses ? "active-toolbar-tab" : "inactive-toolbar-tab" %>
  • <% end %> diff --git a/app/views/dashboard/index.html.erb b/app/views/dashboard/index.html.erb index a2a1e0c..5ff9740 100644 --- a/app/views/dashboard/index.html.erb +++ b/app/views/dashboard/index.html.erb @@ -1,2 +1 @@ -<%= render partial: "components/toolbar", locals: { active_tab: :budget_calculator } %> <%= render partial: "dashboard/index" %> diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 91033a0..5617df3 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -14,6 +14,7 @@
    + <%= render partial: "components/toolbar", locals: { active_tab: :budget_calculator } %> <%= yield %>