diff --git a/app/controllers/con_tech_records_controller.rb b/app/controllers/con_tech_records_controller.rb index ca2bafdc..ba211db9 100644 --- a/app/controllers/con_tech_records_controller.rb +++ b/app/controllers/con_tech_records_controller.rb @@ -9,9 +9,9 @@ def create @conservation_record = ConservationRecord.find(params[:conservation_record_id]) @con_tech_record = @conservation_record.con_tech_records.create(create_params) if @con_tech_record.valid? - redirect_to conservation_record_path(@conservation_record) + redirect_to "#{conservation_record_path(@conservation_record)}#conservators-and-technicians" else - redirect_to conservation_record_path(@conservation_record), + redirect_to "#{conservation_record_path(@conservation_record)}#conservators-and-technicians", notice: "Conservator/Technician record not saved: #{@con_tech_record.errors.full_messages[0]}" end end @@ -20,7 +20,7 @@ def destroy @conservation_record = ConservationRecord.find(params[:conservation_record_id]) @con_tech_record = @conservation_record.con_tech_records.find(params[:id]) @con_tech_record.destroy - redirect_to conservation_record_path(@conservation_record) + redirect_to "#{conservation_record_path(@conservation_record)}#conservators-and-technicians" end private diff --git a/app/controllers/cost_return_reports_controller.rb b/app/controllers/cost_return_reports_controller.rb index c410bfad..412dab70 100644 --- a/app/controllers/cost_return_reports_controller.rb +++ b/app/controllers/cost_return_reports_controller.rb @@ -8,20 +8,20 @@ class CostReturnReportsController < ApplicationController def create @conservation_record = ConservationRecord.find(params[:conservation_record_id]) CostReturnReport.create(cost_return_report_params) - redirect_to conservation_record_path(@conservation_record), notice: 'Treatment record saved successfully' + redirect_to "#{conservation_record_path(@conservation_record)}#cost-and-return-information", notice: 'Treatment record saved successfully' end def update @conservation_record = ConservationRecord.find(params[:conservation_record_id]) @cost_return_report = @conservation_record.cost_return_report.update(cost_return_report_params) - redirect_to conservation_record_path(@conservation_record), notice: 'Treatment record updated' + redirect_to "#{conservation_record_path(@conservation_record)}#cost-and-return-information", notice: 'Treatment record updated' end def destroy @conservation_record = ConservationRecord.find(params[:conservation_record_id]) @cost_return_report = @conservation_record.cost_return_report @cost_return_report.destroy - redirect_to conservation_record_path(@conservation_record) + redirect_to "#{conservation_record_path(@conservation_record)}#cost-and-return-information" end private diff --git a/app/controllers/external_repair_records_controller.rb b/app/controllers/external_repair_records_controller.rb index b314941b..d7ff8f6d 100644 --- a/app/controllers/external_repair_records_controller.rb +++ b/app/controllers/external_repair_records_controller.rb @@ -10,9 +10,10 @@ def create @repair_record = @conservation_record.external_repair_records.create(create_params) if @repair_record.valid? - redirect_to conservation_record_path(@conservation_record) + redirect_to "#{conservation_record_path(@conservation_record)}#external-repairs" else - redirect_to conservation_record_path(@conservation_record), notice: "External repair not saved: #{@repair_record.errors.full_messages[0]}" + redirect_to "#{conservation_record_path(@conservation_record)}#external-repairs", + notice: "External repair not saved: #{@repair_record.errors.full_messages[0]}" end end @@ -20,7 +21,7 @@ def destroy @conservation_record = ConservationRecord.find(params[:conservation_record_id]) @repair_record = @conservation_record.external_repair_records.find(params[:id]) @repair_record.destroy - redirect_to conservation_record_path(@conservation_record) + redirect_to "#{conservation_record_path(@conservation_record)}#external-repairs" end private diff --git a/app/controllers/in_house_repair_records_controller.rb b/app/controllers/in_house_repair_records_controller.rb index a0bde367..f2c63321 100644 --- a/app/controllers/in_house_repair_records_controller.rb +++ b/app/controllers/in_house_repair_records_controller.rb @@ -9,9 +9,10 @@ def create @conservation_record = ConservationRecord.find(params[:conservation_record_id]) @repair_record = @conservation_record.in_house_repair_records.create(create_params) if @repair_record.valid? - redirect_to conservation_record_path(@conservation_record) + redirect_to "#{conservation_record_path(@conservation_record)}#in-house-repairs" else - redirect_to conservation_record_path(@conservation_record), notice: "In house repair not saved: #{@repair_record.errors.full_messages[0]}" + redirect_to "#{conservation_record_path(@conservation_record)}#in-house-repairs", + notice: "In house repair not saved: #{@repair_record.errors.full_messages[0]}" end end @@ -19,7 +20,7 @@ def destroy @conservation_record = ConservationRecord.find(params[:conservation_record_id]) @repair_record = @conservation_record.in_house_repair_records.find(params[:id]) @repair_record.destroy - redirect_to conservation_record_path(@conservation_record) + redirect_to "#{conservation_record_path(@conservation_record)}#in-house-repairs" end private diff --git a/app/controllers/treatment_reports_controller.rb b/app/controllers/treatment_reports_controller.rb index 1bbb11dd..b42fdf75 100644 --- a/app/controllers/treatment_reports_controller.rb +++ b/app/controllers/treatment_reports_controller.rb @@ -7,14 +7,15 @@ def create @treatment_report.save flash - redirect_to conservation_record_path(@treatment_report.conservation_record), notice: 'Treatment record saved successfully!' + redirect_to "#{conservation_record_path(@treatment_report.conservation_record)}#treatment-report-tab", notice: 'Treatment record saved successfully!' end def update @treatment_report = TreatmentReport.find(params[:id]) @treatment_report.update(treatment_report_params) - redirect_to conservation_record_path(@treatment_report.conservation_record), notice: 'Treatment Record updated successfully!' + redirect_to "#{conservation_record_path(@treatment_report.conservation_record)}#treatment-report-tab", + notice: 'Treatment Record updated successfully!' end private diff --git a/app/views/conservation_records/show.html.erb b/app/views/conservation_records/show.html.erb index e0c59e70..172a7851 100644 --- a/app/views/conservation_records/show.html.erb +++ b/app/views/conservation_records/show.html.erb @@ -63,7 +63,7 @@