Skip to content
Snippets Groups Projects
Commit fd5062a8 authored by James Lopez's avatar James Lopez
Browse files

update controller action to render error in form

parent b82fdf62
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -82,10 +82,7 @@ class GroupsController < Groups::ApplicationController
if Groups::UpdateService.new(@group, current_user, group_params).execute
redirect_to edit_group_path(@group), notice: "Group '#{@group.name}' was successfully updated."
else
error = group.errors.full_messages.first
alert_message = "Group '#{@group.name}' cannot be updated: " + error
redirect_to edit_group_path(@group.reload), alert: alert_message
render action: "edit"
end
end
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment