From fd5062a848d63b89248c384e0171c6f1af833a49 Mon Sep 17 00:00:00 2001 From: James Lopez Date: Wed, 21 Dec 2016 11:50:31 +0100 Subject: [PATCH] update controller action to render error in form --- app/controllers/groups_controller.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb index 5c7709ea013..b83c3a872cf 100644 --- a/app/controllers/groups_controller.rb +++ b/app/controllers/groups_controller.rb @@ -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