Sha256: 8b690e39fe6fb97a2173588b25861d603c82060fc908160057d8dc06f622af4d
Contents?: true
Size: 682 Bytes
Versions: 11
Compression:
Stored size: 682 Bytes
Contents
require_dependency "social_networking/application_controller" module SocialNetworking # Manage Participants. class ParticipantsController < ApplicationController rescue_from ActiveRecord::RecordNotFound, with: :record_not_found def index participants = Participant.all render json: Serializers::ParticipantSerializer .from_collection(participants) end def show participant = Participant.find(params[:id]) render json: Serializers::ParticipantSerializer.new(participant) .to_serialized end private def record_not_found render json: { error: "participant not found" }, status: 404 end end end
Version data entries
11 entries across 11 versions & 1 rubygems