OSDN Git Service

speech balloon template changed
[pettanr/pettanr.git] / app / controllers / speech_balloon_templates_controller.rb
index d17ff32..cbb2d5b 100644 (file)
@@ -33,7 +33,7 @@ class SpeechBalloonTemplatesController < ApplicationController
   # GET /speech_balloon_templates
   # GET /speech_balloon_templates.json
   def index
-    @speech_balloon_templates = SpeechBalloon.all
+    @speech_balloon_templates = SpeechBalloonTemplate.all
 
     respond_to do |format|
       format.html # index.html.erb
@@ -44,25 +44,21 @@ class SpeechBalloonTemplatesController < ApplicationController
   # GET /speech_balloon_templates/1
   # GET /speech_balloon_templates/1.json
   def show
-    @speech_balloon_template = SpeechBalloon.find(params[:id], include: {:balloon_templates => :speech_templates})
+    @speech_balloon_template = SpeechBalloonTemplate.find(params[:id])
 
     respond_to do |format|
       format.html # show.html.erb
       format.json {
-        render :json => @speech_balloon_template.to_json(include: {
-          :balloon_templates => {:include => :speech_templates}
-        })
+        render :json => @speech_balloon_template.to_json()
       }
       format.jsonp {
-        render :json => "callback(" + @speech_balloon_template.to_json(include: {
-          :balloon_templates => {:include => :speech_templates}
-        }) + ")"
+        render :json => "callback(" + @speech_balloon_template.to_json() + ")"
       }
     end
   end
 
   def list
-    @speech_balloon_templates = SpeechBalloon.all
+    @speech_balloon_templates = SpeechBalloonTemplate.all
 
     respond_to do |format|
       format.html { render layout: 'system' }
@@ -71,7 +67,7 @@ class SpeechBalloonTemplatesController < ApplicationController
   end
 
   def browse
-    @speech_balloon_template = SpeechBalloon.find(params[:id])
+    @speech_balloon_template = SpeechBalloonTemplate.find(params[:id])
 
     respond_to do |format|
       format.html { render layout: 'system' }
@@ -82,7 +78,7 @@ class SpeechBalloonTemplatesController < ApplicationController
   # POST /speech_balloon_templates
   # POST /speech_balloon_templates.json
   def create
-    @speech_balloon_template = SpeechBalloon.new(params[:speech_balloon_template])
+    @speech_balloon_template = SpeechBalloonTemplate.new(params[:speech_balloon_template])
     if em = validate_param(params[:speech_balloon_template])
       respond_to do |format|
         format.json { render json: em, status: :unprocessable_entity }
@@ -103,11 +99,11 @@ class SpeechBalloonTemplatesController < ApplicationController
   # DELETE /speech_balloon_templates/1
   # DELETE /speech_balloon_templates/1.json
   def destroy
-    @speech_balloon_template = SpeechBalloon.find(params[:id])
+    @speech_balloon_template = SpeechBalloonTemplate.find(params[:id])
     @speech_balloon_template.destroy
 
     respond_to do |format|
-      format.html { redirect_to speech_balloon_templates_url }
+      format.html { redirect_to :action => :list }
       format.json { head :ok }
     end
   end