OSDN Git Service

fix orm
[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_html_format format
23     format.html {
24       @license = @item
25     }
26   end
27   
28   def show
29     set_show
30     respond_to do |format|
31       show_html_format format
32       show_prof_format format
33       show_json_format format
34     end
35   end
36
37   def search
38     @licenses = License.list_by_name(params[:name])
39     
40     respond_to do |format|
41       format.html
42       format.json { render json: @licenses.to_json }
43     end
44   end
45   
46   def count
47     list_count
48   end
49   
50   def count_by_license_group
51     list_count
52   end
53   
54   def count_by_system_picture
55     list_count
56   end
57   
58 end