OSDN Git Service

Merge branch 'v05' of git.sourceforge.jp:/gitroot/pettanr/pettanr into v05
[pettanr/pettanr.git] / app / controllers / licenses_controller.rb
index 6e89e30..d30b226 100644 (file)
@@ -1,5 +1,5 @@
 class LicensesController < ApplicationController
-  layout 'test' if Pettanr::TestLayout
+  layout 'test' if MagicNumber['test_layout']
   before_filter :authenticate_admin!, :only => [:list, :browse]
 
   # GET /licenses
@@ -23,6 +23,15 @@ class LicensesController < ApplicationController
     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