OSDN Git Service

comic test error
authoryasushiito <yasushiito@git.sourceforge.jp>
Tue, 27 Mar 2012 08:22:34 +0000 (17:22 +0900)
committeryasushiito <yasushiito@git.sourceforge.jp>
Tue, 27 Mar 2012 08:22:34 +0000 (17:22 +0900)
app/controllers/comics_controller.rb

index d2668b6..9ab0eb4 100644 (file)
@@ -47,7 +47,7 @@ class ComicsController < ApplicationController
     respond_to do |format|
       raise ActiveRecord::Forbidden unless @comic.visible?(@author)
       format.html # show.html.erb
     respond_to do |format|
       raise ActiveRecord::Forbidden unless @comic.visible?(@author)
       format.html # show.html.erb
-      format.json { render json: @comic.to_json(Comic.show_json_opt) }
+      format.json { render json: @comic.to_json(Comic.show_json_include_opt) }
     end
   end
 
     end
   end
 
@@ -122,7 +122,7 @@ class ComicsController < ApplicationController
     respond_to do |format|
       if @comic.save
         format.html { redirect_to @comic, notice: 'Comic was successfully created.' }
     respond_to do |format|
       if @comic.save
         format.html { redirect_to @comic, notice: 'Comic was successfully created.' }
-        format.json { render json: Comic.show(@comic.id).to_json(Comic.show_json_opt), status: :created, location: @comic }
+        format.json { render json: Comic.show(@comic.id).to_json(Comic.show_json_include_opt), status: :created, location: @comic }
       else
         format.html { render action: "new" }
         format.json { render json: @comic.errors, status: :unprocessable_entity }
       else
         format.html { render action: "new" }
         format.json { render json: @comic.errors, status: :unprocessable_entity }