OSDN Git Service

Merge branch 'v06' of git.sourceforge.jp:/gitroot/pettanr/pettanr into v06
[pettanr/pettanr.git] / app / controllers / licenses_controller.rb
1 class LicensesController < ApplicationController
2   before_filter :authenticate_resource_reader, :only => [
3     :by_license_group, :by_system_picture, :count_by_license_group, :count_by_system_picture
4   ]
5
6   def self.model
7     License
8   end
9   
10   def index
11     filer_list
12   end
13   
14   def by_license_group
15     filer_list
16   end
17   
18   def by_system_picture
19     filer_list
20   end
21   
22   def show
23     @item = License.show(params[:id], @operators)
24     respond_to do |format|
25       format.html {
26         @license = @item
27       }
28       format_prof format
29       format.json { render json: @item.to_json(License.show_json_opt) }
30     end
31   end
32
33   def search
34     @licenses = License.list_by_name(params[:name])
35     
36     respond_to do |format|
37       format.html
38       format.json { render json: @licenses.to_json }
39     end
40   end
41   
42   def count
43     list_count
44   end
45   
46   def count_by_license_group
47     list_count
48   end
49   
50   def count_by_system_picture
51     list_count
52   end
53   
54 end