Class: API::V1::ContactDetailsController

Inherits:
Faalis::APIController
  • Object
show all
Defined in:
app/controllers/api/v1/contact_details_controller.rb

Instance Method Summary collapse

Instance Method Details

#build_resourceObject



10
11
12
# File 'app/controllers/api/v1/contact_details_controller.rb', line 10

def build_resource
  @contact_details = ::ContactDetails.new(resource_params)
end

#destroyObject



3
4
5
6
7
8
# File 'app/controllers/api/v1/contact_details_controller.rb', line 3

def destroy
  ids = params[:id].split(",")
  @contact_details = ::ContactDetails.where(:id => ids)
  authorize! :destroy, ContactDetails
  @contact_details.destroy_all
end

#resource_paramsObject



14
15
16
# File 'app/controllers/api/v1/contact_details_controller.rb', line 14

def resource_params
  params.require(:contact_details).permit(:id, :details_value)
end