1 class SpeechBalloonsController < ApplicationController
2 layout 'test' if MagicNumber['test_layout']
3 if MagicNumber['run_mode'] == 0
4 before_filter :authenticate_user!, :only => []
5 before_filter :authenticate_author, :only => []
7 before_filter :authenticate_user!, :only => [:index, :show]
8 before_filter :authenticate_author, :only => [:index, :show]
10 before_filter :authenticate_admin!, :only => [:list, :browse]
13 @page = SpeechBalloon.page params[:page]
14 @page_size = SpeechBalloon.page_size params[:page_size]
15 @speech_balloons = SpeechBalloon.list(@page, @page_size)
17 respond_to do |format|
18 format.html # index.html.erb
19 format.json { render json: @speech_balloons.to_json(SpeechBalloon.list_json_opt) }
24 @speech_balloon = SpeechBalloon.show(params[:id], @author)
25 respond_to do |format|
26 format.html # show.html.erb
27 format.json { render json: @speech_balloon.to_json(SpeechBalloon.show_json_opt) }
32 @speech_balloons = SpeechBalloon.all
34 respond_to do |format|
35 format.html { render layout: 'system' }
36 format.json { render json: @speech_balloons }
41 @speech_balloon = SpeechBalloon.find(params[:id])
43 respond_to do |format|
44 format.html { render layout: 'system' }
45 format.json { render json: @speech_balloon }