Report verification render not redirect

Fix an issue with the report verification, causing it to lose the text of a report if the user fails to fill in a category.

By using a `render` instead of a `redirect_to`, the rails standard verification behaviour works better. It means we also get a nice red "can't be blank" message highlighting the specific missing field.
This commit is contained in:
Harry Wood 2022-05-04 16:34:40 +01:00
parent fa77b55bd5
commit fcbccb6a44
2 changed files with 6 additions and 3 deletions

View file

@ -28,7 +28,8 @@ class ReportsController < ApplicationController
redirect_to helpers.reportable_url(@report.issue.reportable), :notice => t(".successful_report")
else
redirect_to new_report_path(:reportable_type => @report.issue.reportable_type, :reportable_id => @report.issue.reportable_id), :notice => t(".provide_details")
flash[:notice] = t(".provide_details")
render :action => "new"
end
end