Class: Admin::ShotsController

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

Instance Method Summary collapse

Instance Method Details

#indexObject

GET /shots GET /shots.csv


15
16
17
18
19
20
21
22
# File 'app/controllers/admin/shots_controller.rb', line 15

def index
  @presenter = Admin::Shots::IndexPresenter.new(current_user, params[:page], params[:q], params[:animal_id])
  respond_with(@shots) do |format|
    format.html
    format.csv { render :csv => Shot.includes(:animal).organization(current_user),
                        :filename => 'shots' }
  end
end

#showObject

GET /shots/1 GET /shots/1.xml


26
27
28
29
30
# File 'app/controllers/admin/shots_controller.rb', line 26

def show
  @presenter = Admin::Shots::ShowPresenter.new(params[:id], current_user)

  respond_with(@shot)
end