Class: Admin::StatusesController

Inherits:
CrudController
  • Object
show all
Defined in:
app/controllers/admin/statuses_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject

GET /statuses GET /statuses.xml


14
15
16
17
18
19
# File 'app/controllers/admin/statuses_controller.rb', line 14

def index
  @search = Status.includes(:animals).organization(current_user).search(params[:q])
  @statuses = @search.result.paginate(:page => params[:page], :per_page => 10).order("updated_at DESC")
  
  respond_with(@statuses)
end

#showObject

GET /statuses/1 GET /statuses/1.xml


23
24
25
26
27
28
# File 'app/controllers/admin/statuses_controller.rb', line 23

def show
  @status = Status.find(params[:id])
  @animals = Animal.where(:status_id => @status.id).order("name ASC")
  
  respond_with(@status)
end