OSDN Git Service

temp
[pettanr/pettanr.git] / app / controllers / speech_balloon_templates_controller.rb
index 051b9da..c89db4b 100644 (file)
@@ -8,29 +8,26 @@ class SpeechBalloonTemplatesController < ApplicationController
   end
   before_filter :authenticate_admin!, :only => [:list, :browse, :destroy]
 
-  # GET /speech_balloon_templates
-  # GET /speech_balloon_templates.json
+  @@model = SpeechBalloonTemplate
   def index
-    @speech_balloon_templates = SpeechBalloonTemplate.list
+    set_filer
 
     respond_to do |format|
-      format.html # index.html.erb
-      format.json { render json: @speech_balloon_templates.to_json(SpeechBalloonTemplate.list_json_opt) }
+      format_filer format
+      format.json { render json: @items.to_json(@@model.list_json_opt) }
     end
   end
 
-  # GET /speech_balloon_templates/1
-  # GET /speech_balloon_templates/1.json
   def show
-    @speech_balloon_template = SpeechBalloonTemplate.show(params[:id], [@user, @admin])
+    @item = SpeechBalloonTemplate.show(params[:id], @operators)
 
     respond_to do |format|
-      format.html # show.html.erb
-      format.json {
-        render :json => @speech_balloon_template.to_json(SpeechBalloonTemplate.show_json_opt)
+      format.html {
+        @speech_balloon_template = @item
       }
-      format.jsonp {
-        render :json => "callback(" + @speech_balloon_template.to_json() + ")"
+      format_prof format
+      format.json {
+        render :json => @item.to_json(SpeechBalloonTemplate.show_json_opt)
       }
     end
   end
@@ -53,8 +50,6 @@ class SpeechBalloonTemplatesController < ApplicationController
     end
   end
 
-  # DELETE /speech_balloon_templates/1
-  # DELETE /speech_balloon_templates/1.json
   def destroy
     @speech_balloon_template = SpeechBalloonTemplate.find(params[:id])
     @speech_balloon_template.destroy