OSDN Git Service

import all source code
[pettanr/pettanr.git] / app / controllers / speach_templates_controller.rb
1 class SpeachTemplatesController < ApplicationController
2   before_filter :authenticate_author!, :except => [:index]
3
4   # GET /speach_templates
5   # GET /speach_templates.json
6   def index
7     @speach_templates = SpeachTemplate.all
8
9     respond_to do |format|
10       format.html # index.html.erb
11       format.json { render json: @speach_templates }
12     end
13   end
14
15 =begin
16   # GET /speach_templates/1
17   # GET /speach_templates/1.json
18   def show
19     @speach_template = SpeachTemplate.find(params[:id])
20
21     respond_to do |format|
22       format.html # show.html.erb
23       format.json { render json: @speach_template }
24     end
25   end
26
27   # GET /speach_templates/new
28   # GET /speach_templates/new.json
29   def new
30     @speach_template = SpeachTemplate.new
31
32     respond_to do |format|
33       format.html # new.html.erb
34       format.json { render json: @speach_template }
35     end
36   end
37
38   # GET /speach_templates/1/edit
39   def edit
40     @speach_template = SpeachTemplate.find(params[:id])
41   end
42
43   # POST /speach_templates
44   # POST /speach_templates.json
45   def create
46     @speach_template = SpeachTemplate.new(params[:speach_template])
47
48     respond_to do |format|
49       if @speach_template.save
50         format.html { redirect_to @speach_template, notice: 'Speach template was successfully created.' }
51         format.json { render json: @speach_template, status: :created, location: @speach_template }
52       else
53         format.html { render action: "new" }
54         format.json { render json: @speach_template.errors, status: :unprocessable_entity }
55       end
56     end
57   end
58
59   # PUT /speach_templates/1
60   # PUT /speach_templates/1.json
61   def update
62     @speach_template = SpeachTemplate.find(params[:id])
63
64     respond_to do |format|
65       if @speach_template.update_attributes(params[:speach_template])
66         format.html { redirect_to @speach_template, notice: 'Speach template was successfully updated.' }
67         format.json { head :ok }
68       else
69         format.html { render action: "edit" }
70         format.json { render json: @speach_template.errors, status: :unprocessable_entity }
71       end
72     end
73   end
74
75   # DELETE /speach_templates/1
76   # DELETE /speach_templates/1.json
77   def destroy
78     @speach_template = SpeachTemplate.find(params[:id])
79     @speach_template.destroy
80
81     respond_to do |format|
82       format.html { redirect_to speach_templates_url }
83       format.json { head :ok }
84     end
85   end
86 =end
87 end