1 class ArtistsController < ApplicationController
2 before_filter :authenticate_author!, :only => [:index, :show, :create, :update, :destroy]
3 before_filter :authenticate_admin!, :only => [:list, :browse]
10 respond_to do |format|
11 format.html # index.html.erb
12 format.json { render json: @artists }
19 @artist = Artist.find(params[:id])
21 respond_to do |format|
22 format.html # show.html.erb
23 format.json { render json: @artist }
30 respond_to do |format|
31 format.html { render layout: 'system' }
32 format.json { render json: @artists }
37 @artist = Artist.find(params[:id])
39 respond_to do |format|
40 format.html { render layout: 'system' }
41 format.json { render json: @artist }
46 # GET /artists/new.json
50 respond_to do |format|
51 format.html # new.html.erb
52 format.json { render json: @artist }
58 @artist = Artist.find(params[:id])
64 @artist = Artist.new(params[:artist])
66 respond_to do |format|
68 format.html { redirect_to @artist, notice: 'Artist was successfully created.' }
69 format.json { render json: @artist, status: :created, location: @artist }
71 format.html { render action: "new" }
72 format.json { render json: @artist.errors, status: :unprocessable_entity }
80 @artist = Artist.find(params[:id])
82 respond_to do |format|
83 if @artist.update_attributes(params[:artist])
84 format.html { redirect_to @artist, notice: 'Artist was successfully updated.' }
85 format.json { head :ok }
87 format.html { render action: "edit" }
88 format.json { render json: @artist.errors, status: :unprocessable_entity }
94 # DELETE /artists/1.json
96 @artist = Artist.find(params[:id])
99 respond_to do |format|
100 format.html { redirect_to artists_url }
101 format.json { head :ok }