diff options
author | jomo <github@jomo.tv> | 2014-05-02 05:12:16 +0200 |
---|---|---|
committer | jomo <github@jomo.tv> | 2014-05-02 05:12:16 +0200 |
commit | a2ac6582b16c015e4d424cf1fdd534f99bb1e453 (patch) | |
tree | e841db11908e0a0272e854e8b7b25446559fe86b /app/controllers/forums_controller.rb | |
parent | 04066ba49f6a6b4cf41536080ab97528634978cb (diff) |
relative timestamps
Diffstat (limited to 'app/controllers/forums_controller.rb')
-rw-r--r-- | app/controllers/forums_controller.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/app/controllers/forums_controller.rb b/app/controllers/forums_controller.rb index 8244810..48bfec1 100644 --- a/app/controllers/forums_controller.rb +++ b/app/controllers/forums_controller.rb @@ -57,6 +57,21 @@ class ForumsController < ApplicationController end end + def destroy + if admin? + if @forum.destroy + flash[:notice] = "Forum deleted." + else + flash[:alert] = "Something went wrong" + render :new + return + end + else + flash[:alert] = "You are not allowed to delete a forum." + end + redirect_to forums_path + end + private |