OSDN Git Service

list browser created
[pettanr/pettanr.git] / app / controllers / artists_controller.rb
index 442890a..a2fa524 100644 (file)
@@ -1,4 +1,7 @@
 class ArtistsController < ApplicationController
+  before_filter :authenticate_author!, :only => [:index, :show, :create, :update, :destroy]
+  before_filter :authenticate_admin!, :only => [:list, :browse]
+
   # GET /artists
   # GET /artists.json
   def index
@@ -21,6 +24,24 @@ class ArtistsController < ApplicationController
     end
   end
 
+  def list
+    @artists = Artist.all
+
+    respond_to do |format|
+      format.html { render layout: 'system' }
+      format.json { render json: @artists }
+    end
+  end
+
+  def browse
+    @artist = Artist.find(params[:id])
+
+    respond_to do |format|
+      format.html { render layout: 'system' }
+      format.json { render json: @artist }
+    end
+  end
+
   # GET /artists/new
   # GET /artists/new.json
   def new