OSDN Git Service

pass model test for show, list
[pettanr/pettanr.git] / app / controllers / license_groups_controller.rb
1 class LicenseGroupsController < ApplicationController
2   before_filter :authenticate_admin!, :only => [:list, :browse]
3   
4   # GET /license_groups
5   # GET /license_groups.json
6   def index
7     @license_groups = LicenseGroup.list({})
8
9     respond_to do |format|
10       format.html # index.html.erb
11       format.json { render json: @license_groups.to_json(LicenseGroup.list_json_opt) }
12     end
13   end
14
15   # GET /license_groups/1
16   # GET /license_groups/1.json
17   def show
18     @license_group = LicenseGroup.show(params[:id])
19     respond_to do |format|
20       format.html # show.html.erb
21       format.json { render json: @license_group.to_json(LicenseGroup.show_json_include_opt) }
22     end
23   end
24
25   def list
26     @license_groups = LicenseGroup.all
27
28     respond_to do |format|
29       format.html { render layout: 'system' }
30     end
31   end
32
33   def browse
34     @license_group = LicenseGroup.find(params[:id])
35
36     respond_to do |format|
37       format.html { render layout: 'system' }
38     end
39   end
40 end