moved artist ban to separate action/button

This commit is contained in:
albert
2013-02-23 10:56:27 -05:00
parent 7585462368
commit 6bc5b96d8e
5 changed files with 11 additions and 13 deletions

View File

@@ -1,6 +1,7 @@
class ArtistsController < ApplicationController
respond_to :html, :xml, :json
before_filter :member_only, :except => [:index, :show, :banned]
before_filter :admin_only, :only => [:ban]
def new
@artist = Artist.new_with_defaults(params)
@@ -17,6 +18,12 @@ class ArtistsController < ApplicationController
respond_with(@artists)
end
def ban
@artist = Artist.find(params[:id])
@artist.ban!
redirect_to(artist_path(@artist), :notice => "Artist was banned")
end
def index
@artists = Artist.search(params[:search]).order("id desc").paginate(params[:page])
respond_with(@artists) do |format|