moved artist ban to separate action/button
This commit is contained in:
@@ -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|
|
||||
|
||||
Reference in New Issue
Block a user