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

Version Path
social_networking-0.11.8 app/controllers/social_networking/participants_controller.rb
social_networking-0.11.7 app/controllers/social_networking/participants_controller.rb
social_networking-0.11.6 app/controllers/social_networking/participants_controller.rb
social_networking-0.11.5 app/controllers/social_networking/participants_controller.rb
social_networking-0.11.4 app/controllers/social_networking/participants_controller.rb
social_networking-0.11.3 app/controllers/social_networking/participants_controller.rb
social_networking-0.11.2 app/controllers/social_networking/participants_controller.rb
social_networking-0.11.1 app/controllers/social_networking/participants_controller.rb
social_networking-0.11.0 app/controllers/social_networking/participants_controller.rb
social_networking-0.10.0 app/controllers/social_networking/participants_controller.rb
social_networking-0.9.3 app/controllers/social_networking/participants_controller.rb