Commit 1f274691 authored by Chrysanthi Lagodimou's avatar Chrysanthi Lagodimou
Browse files

Use path for redirect at take_responsibility spv

parent c79e4db4
...@@ -5,8 +5,7 @@ class SemesterProcessVolunteersController < ApplicationController ...@@ -5,8 +5,7 @@ class SemesterProcessVolunteersController < ApplicationController
include SemesterProcessVolunteerHelper include SemesterProcessVolunteerHelper
def review_semester def review_semester; end
end
def submit_review def submit_review
# you shall not pass # you shall not pass
...@@ -62,14 +61,14 @@ class SemesterProcessVolunteersController < ApplicationController ...@@ -62,14 +61,14 @@ class SemesterProcessVolunteersController < ApplicationController
def take_responsibility def take_responsibility
respond_to do |format| respond_to do |format|
if @spv.update(responsible: current_user) if @spv.update(responsible: current_user)
format.html { redirect_to(@redirect_back_path, notice: 'Halbjahres-Rapport übernommen.') } format.html { redirect_to semester_process_volunteers_path, notice: 'Halbjahres-Rapport übernommen.' }
format.json do format.json do
render json: { link: url_for(@spv.responsible), at: I18n.l(@spv.responsibility_taken_at.to_date), render json: { link: url_for(@spv.responsible), at: I18n.l(@spv.responsibility_taken_at.to_date),
email: @spv.responsible.email }, status: :ok email: @spv.responsible.email }, status: :ok
end end
else else
format.html { redirect_to(@redirect_back_path, notice: 'Fehler: Übernehmen fehlgeschlagen.') } format.html { redirect_to semester_process_volunteers_path, notice: 'Fehler: Quittieren fehlgeschlagen.' }
format.json { render json: { errors: @spv.errors.messages }, status: :unprocessable_entity } format.json { render json: { errors: @spv.errors.messages }, status: :unprocessable_entity }
end end
end end
end end
...@@ -100,10 +99,10 @@ class SemesterProcessVolunteersController < ApplicationController ...@@ -100,10 +99,10 @@ class SemesterProcessVolunteersController < ApplicationController
def review_params def review_params
params.require(:semester_process_volunteer).permit( params.require(:semester_process_volunteer).permit(
volunteer_attributes: [:id ,:waive, :iban, :bank], volunteer_attributes: [:id, :waive, :iban, :bank],
semester_feedbacks_attributes: [[semester_feedback: [:mission, :goals, :achievements, :future, :comments, :conversation, :spv_mission_id]], semester_feedbacks_attributes: [[semester_feedback: [:mission, :goals, :achievements, :future, :comments, :conversation, :spv_mission_id]],
[hour: [:hours, :spv_mission_id ]]]) [hour: [:hours, :spv_mission_id]]]
)
end end
def set_semester_process_volunteer def set_semester_process_volunteer
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment