OSDN Git Service

temp
[pettanr/pettanr.git] / app / controllers / ground_pictures_controller.rb
index 7763724..9de2107 100644 (file)
@@ -9,25 +9,18 @@ class GroundPicturesController < ApplicationController
     before_filter :authenticate_author, :only => [:new, :edit, :create, :update, :destroy]
   end
 
+  @@model = GroundPicture
   def index
-    @page = GroundPicture.page params[:page]
-    @page_size = GroundPicture.page_size params[:page_size]
-    @ground_pictures = GroundPicture.list(@page, @page_size)
+    set_filer
 
     respond_to do |format|
-      format.html {
-        @paginate = GroundPicture.list_paginate(@page, @page_size)
-        render :template => 'system/filer', :locals => {
-          :items => @ground_pictures, :model => GroundPicture, 
-          :roles => [@user, @admin], :pager => @paginate
-        }
-      }
-      format.json { render :json => @ground_pictures.to_json(GroundPicture.list_json_opt) }
+      format_filer format
+      format.json { render json: @items.to_json(@@model.list_json_opt) }
     end
   end
 
   def show
-    @item = GroundPicture.show(params[:id], [@user, @admin])
+    @item = GroundPicture.show(params[:id], @operators)
     respond_to do |format|
       format.html {
         @ground_picture = @item