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
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 }