OSDN Git Service

fix: fetch fail
[pettanr/pettanr.git] / app / controllers / artists_controller.rb
1 class ArtistsController < ApplicationController
2   if Manifest.manifest.magic_numbers['run_mode'] == 0
3     before_action :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
4     before_action :authenticate_artist, :only => [:edit, :update, :destroy]
5   else
6     before_action :authenticate_resource_reader, :only => [
7       :index, :show
8     ]
9     before_action :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
10     before_action :authenticate_artist, :only => [:edit, :update, :destroy]
11   end
12   
13   def index
14     filer_list
15   end
16   
17   def show_html_format format
18     format.html {
19     }
20   end
21   
22   def show
23     set_show
24     respond_to do |format|
25       show_html_format format
26       show_prof_format format
27       show_json_format format
28     end
29   end
30   
31   def new
32     form_new
33   end
34   
35   def edit
36     form_edit
37   end
38   
39   def create
40     set_model
41     @item = @my_model_class.new
42     @item.supply_default 
43     @item.attributes = @item.permit_params params
44     @item.overwrite @operators
45     render_create root_path
46   end
47   
48   def update
49     set_edit
50     @item.attributes = @item.permit_params params
51     @item.overwrite @operators
52     render_update '/home/configure'
53   end
54   
55   def destroy
56     set_model
57     @item = @my_model_class.edit(params[:id], @operators)
58     render_destroy '/home/configure'
59   end
60   
61 end