Class: Gaku::Api::V1::ContactsController

Inherits:
BaseController show all
Defined in:
app/controllers/gaku/api/v1/contacts_controller.rb

Instance Attribute Summary

Attributes inherited from BaseController

#current_user

Instance Method Summary collapse

Instance Method Details

#createObject



14
15
16
17
# File 'app/controllers/gaku/api/v1/contacts_controller.rb', line 14

def create
  @contact = @contactable.contacts.create(contact_params)
  member_respond_to @contact
end

#indexObject



9
10
11
12
# File 'app/controllers/gaku/api/v1/contacts_controller.rb', line 9

def index
  @contacts = @contactable.contacts.all
  collection_respond_to @contacts, root: :contacts
end