This commit is contained in:
albert
2010-11-19 16:24:17 -05:00
parent a156cc8c62
commit c6304c6e08
41 changed files with 346 additions and 53 deletions

View File

@@ -1,4 +1,6 @@
class BansController < ApplicationController
before_filter :moderator_only, :except => [:show, :index]
def new
@ban = Ban.new
end
@@ -19,7 +21,7 @@ class BansController < ApplicationController
def create
@ban = Ban.new(params[:ban])
if @ban.save
redirect_to ban_path(@ban)
redirect_to ban_path(@ban), :notice => "Ban created"
else
render :action => "new"
end
@@ -28,9 +30,14 @@ class BansController < ApplicationController
def update
@ban = Ban.find(params[:id])
if @ban.update_attributes(params[:ban])
redirect_to ban_path(@ban)
redirect_to ban_path(@ban), :notice => "Ban updated"
else
render :action => "edit"
end
end
def destroy
@ban = Ban.find(params[:id])
@ban.destroy
end
end