Class: Admin::SheltersController

Inherits:
CrudController
  • Object
show all
Includes:
PublicActivity::StoreController
Defined in:
app/controllers/admin/shelters_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject

GET /shelters GET /shelters.xml


16
17
18
19
20
21
22
23
24
# File 'app/controllers/admin/shelters_controller.rb', line 16

def index
  @search = Shelter.includes(:animals).organization(current_user).search(params[:q])
  @shelters = @search.result.paginate(:page => params[:page], :per_page => 10).order("updated_at DESC")
  respond_with(@shelters) do |format|
    format.html # index.html.erb
    format.csv { render :csv => Shelter.organization(current_user),
                        :filename => 'shelters' }
  end
end