Class: Admin::AdoptionContactsController

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

Instance Method Summary collapse

Instance Method Details

#indexObject

GET /adoption_contacts GET /adoption_contacts.xml


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

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

#showObject

GET /adoption_contacts/1 GET /adoption_contacts/1.xml


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

def show
  @adoption_contact = AdoptionContact.find(params[:id])
  @animals = AdoptionContact.find(params[:id]).animals
  @adoptable_animals = Animal.organization(current_user)
  
  respond_with(@adoption_contact)
end