OSDN Git Service

add: short cut
[pettanr/pettanr.git] / app / controllers / folders_controller.rb
index 07ae91a..f535d7a 100644 (file)
@@ -29,7 +29,20 @@ class FoldersController < ApplicationController
   end
   
   def index
-    filer_list
+    if params['path']  # secret api
+      list = Folder.where(['name = ?', params['path']])
+      respond_to do |format|
+        format.json {
+          res = {
+            :page_status => {:type => :unlimited},
+            :list => list
+          }
+          render json: res.to_json
+        }
+      end
+    else
+      filer_list
+    end
   end
   
   def children_html_format format
@@ -74,4 +87,10 @@ class FoldersController < ApplicationController
     list_count
   end
   
+  def destroy
+    set_model
+    @item = @my_model_class.edit(params[:id], @operators)
+    render_destroy '/' + @my_model_class.path_name
+  end
+  
 end