OSDN Git Service

t#32402:add file prof
[pettanr/pettanr.git] / app / controllers / licenses_controller.rb
index 59e24e2..2754dd2 100644 (file)
@@ -8,7 +8,12 @@ class LicensesController < ApplicationController
     @licenses = License.list()
 
     respond_to do |format|
-      format.html # index.html.erb
+      format.html {
+        render :template => 'system/filer', :locals => {
+          :items => @licenses, :model => License, 
+          :roles => [@user, @admin], :pager => nil
+        }
+      }
       format.json { render json: @licenses.to_json(License.list_json_opt) }
     end
   end
@@ -19,10 +24,20 @@ class LicensesController < ApplicationController
     @license = License.show(params[:id])
     respond_to do |format|
       format.html # show.html.erb
+      format.prof  { render :template => 'top/prof', :layout => true }
       format.json { render json: @license.to_json(License.show_json_opt) }
     end
   end
 
+  def search
+    @licenses = License.list_by_name(params[:name])
+    
+    respond_to do |format|
+      format.html
+      format.json { render json: @licenses.to_json }
+    end
+  end
+  
   def list
     @licenses = License.all