A simple twilio app in rails and angular

call_logs_controller.rb 308B

123456789101112131415
  1. class CallLogsController < ApplicationController
  2. def index
  3. render json: CallLog.all
  4. end
  5. def show
  6. call_log = CallLog.find_by_id(params[:id])
  7. if call_log.nil?
  8. ret_message = {error: "Message not found with ID #{params[:id]}"}
  9. end
  10. render json: ret_message || call_log
  11. end
  12. end