OSDN Git Service

t#29400:update:itr2
[pettanr/pettanr.git] / app / controllers / artists_controller.rb
index 52c4f24..afacb4a 100644 (file)
@@ -61,13 +61,17 @@ layout 'test'
     respond_to do |format|
       format.html # new.html.erb
       format.js
-      format.json { render json: @artist }
+      format.json { render json: @artist.to_json(Artist.show_json_opt) }
     end
   end
 
   # GET /artists/1/edit
   def edit
     @artist = Artist.edit(params[:id], @author)
+    respond_to do |format|
+      format.html 
+      format.js
+    end
   end
 
   # POST /artists
@@ -80,7 +84,7 @@ layout 'test'
     respond_to do |format|
       if @artist.save
         format.html { redirect_to @artist, notice: 'Artist was successfully created.' }
-        format.json { render json: @artist, status: :created, location: @artist }
+        format.json { render json: @artist.to_json(Artist.show_json_opt), status: :created, location: @artist }
       else
         format.html { render action: "new" }
         format.json { render json: @artist.errors, status: :unprocessable_entity }