add forum group destroying, fix forum destroy redirect

This commit is contained in:
jomo
2014-06-23 03:23:54 +02:00
parent f7b3045882
commit 58a5d6f02f
2 changed files with 14 additions and 1 deletions
+13
View File
@@ -56,6 +56,19 @@ class ForumgroupsController < ApplicationController
end end
end end
def destroy
if admin?
if @group.destroy
flash[:notice] = "forum group deleted."
else
flash[:alert] = "Something went wrong"
end
else
flash[:alert] = "You are not allowed to delete forum groups."
end
redirect_to forums_path
end
private private
def group_params(add = []) def group_params(add = [])
+1 -1
View File
@@ -63,7 +63,7 @@ class ForumsController < ApplicationController
flash[:notice] = "Forum deleted." flash[:notice] = "Forum deleted."
else else
flash[:alert] = "Something went wrong" flash[:alert] = "Something went wrong"
render :new redirect_to @forum
return return
end end
else else