1 class SpeechBalloonTemplatesController < ApplicationController
2 before_filter :authenticate_user!, :only => [:index, :show]
3 before_filter :authenticate_admin!, :only => [:list, :browse, :destroy]
5 # GET /speech_balloon_templates
6 # GET /speech_balloon_templates.json
8 @speech_balloon_templates = SpeechBalloonTemplate.list
10 respond_to do |format|
11 format.html # index.html.erb
12 format.json { render json: @speech_balloon_templates }
16 # GET /speech_balloon_templates/1
17 # GET /speech_balloon_templates/1.json
19 @speech_balloon_template = SpeechBalloonTemplate.show(params[:id])
21 respond_to do |format|
22 format.html # show.html.erb
24 render :json => @speech_balloon_template.to_json()
27 render :json => "callback(" + @speech_balloon_template.to_json() + ")"
33 @speech_balloon_templates = SpeechBalloonTemplate.all
35 respond_to do |format|
36 format.html { render layout: 'system' }
37 format.json { render json: @speech_balloon_templates }
42 @speech_balloon_template = SpeechBalloonTemplate.find(params[:id])
44 respond_to do |format|
45 format.html { render layout: 'system' }
46 format.json { render json: @speech_balloon_template }
50 # POST /speech_balloon_templates
51 # POST /speech_balloon_templates.json
55 # DELETE /speech_balloon_templates/1
56 # DELETE /speech_balloon_templates/1.json
58 @speech_balloon_template = SpeechBalloonTemplate.find(params[:id])
59 @speech_balloon_template.destroy
61 respond_to do |format|
62 format.html { redirect_to :action => :list }
63 format.json { head :ok }