diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 525c2ca..102a448 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,4 +1,3 @@ class ApplicationController < ActionController::Base include SetDashboardInstanceVariables - end diff --git a/app/controllers/fixed_expenses_controller.rb b/app/controllers/fixed_expenses_controller.rb index c442c1d..36d22df 100644 --- a/app/controllers/fixed_expenses_controller.rb +++ b/app/controllers/fixed_expenses_controller.rb @@ -38,17 +38,16 @@ def create # PATCH/PUT /fixed_expenses/1 or /fixed_expenses/1.json def update - respond_to do |format| if @fixed_expense.update_from_dashboard(params: params[:fixed_expense]) @totals = FixedExpense.total_costs - format.html { redirect_to root_path, notice: "Fixed expense was successfully updated." } - format.turbo_stream + format.html { redirect_to root_path, notice: "Fixed expense was successfully updated." } + format.turbo_stream else - format.html { render :edit, status: :unprocessable_entity } - format.json { render json: @fixed_expense.errors, status: :unprocessable_entity } - end + format.html { render :edit, status: :unprocessable_entity } + format.json { render json: @fixed_expense.errors, status: :unprocessable_entity } end + end end # DELETE /fixed_expenses/1 or /fixed_expenses/1.json