OSDN Git Service

t#29505:md5 search wrote test on picture
[pettanr/pettanr.git] / app / controllers / licenses_controller.rb
1 class LicensesController < ApplicationController
2   layout 'test' if Pettanr::Application.test_layout
3   before_filter :authenticate_admin!, :only => [:list, :browse]
4
5   # GET /licenses
6   # GET /licenses.json
7   def index
8     @licenses = License.list()
9
10     respond_to do |format|
11       format.html # index.html.erb
12       format.json { render json: @licenses.to_json(License.list_json_opt) }
13     end
14   end
15
16   # GET /licenses/1
17   # GET /licenses/1.json
18   def show
19     @license = License.show(params[:id])
20     respond_to do |format|
21       format.html # show.html.erb
22       format.json { render json: @license.to_json(License.show_json_opt) }
23     end
24   end
25
26   def list
27     @licenses = License.all
28
29     respond_to do |format|
30       format.html { render layout: 'system' }
31       format.json { render json: @licenses }
32     end
33   end
34
35   def browse
36     @license = License.find(params[:id])
37
38     respond_to do |format|
39       format.html { render layout: 'system' }
40       format.json { render json: @license }
41     end
42   end
43 end