X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=app%2Fcontrollers%2Fartists_controller.rb;h=4e7f96110535677bce6ef0993167b380dfab3e18;hb=9edc3731389bcae0de05ef6045cceb6b7581cc8f;hp=82145f1263ce8c875272bd432ab3c4817b358f6a;hpb=665761e56525215946e2547a70c82c603d5047af;p=pettanr%2Fpettanr.git diff --git a/app/controllers/artists_controller.rb b/app/controllers/artists_controller.rb index 82145f12..4e7f9611 100644 --- a/app/controllers/artists_controller.rb +++ b/app/controllers/artists_controller.rb @@ -1,11 +1,13 @@ class ArtistsController < ApplicationController if Manifest.manifest.magic_numbers['run_mode'] == 0 - before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy] - before_filter :authenticate_artist, :only => [:edit, :update, :destroy] + before_action :authenticate_user, :only => [:new, :create, :edit, :update, :destroy] + before_action :authenticate_artist, :only => [:edit, :update, :destroy] else - before_filter :authenticate_resource_reader, :only => [:index, :show, :resource_pictures] - before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy] - before_filter :authenticate_artist, :only => [:edit, :update, :destroy] + before_action :authenticate_resource_reader, :only => [ + :index, :show + ] + before_action :authenticate_user, :only => [:new, :create, :edit, :update, :destroy] + before_action :authenticate_artist, :only => [:edit, :update, :destroy] end def index @@ -26,10 +28,6 @@ class ArtistsController < ApplicationController end end - def count - list_count - end - def new form_new end @@ -42,25 +40,22 @@ class ArtistsController < ApplicationController set_model @item = @my_model_class.new @item.supply_default - @item.attributes = params[@my_model_class.item_name] + @item.attributes = @item.permit_params params @item.overwrite @operators render_create root_path end def update set_edit - @item.attributes = params[@my_model_class.item_name] + @item.attributes = @item.permit_params params @item.overwrite @operators render_update '/home/configure' end def destroy - @artist = Artist.edit(params[:id], @operators) - @artist.destroy - - respond_to do |format| - format.html { redirect_to artists_url } - format.json { head :ok } - end + set_model + @item = @my_model_class.edit(params[:id], @operators) + render_destroy '/home/configure' end + end