DigitalNZ/plug

View on GitHub
app/controllers/plug/api/features_controller.rb

Summary

Maintainability
A
15 mins
Test Coverage
require_dependency 'plug/application_controller'

module Plug
  module Api
    class FeaturesController < ApiController
      # GET /features.json
      def index
        @features = Feature.all

        render json: @features
      end

      # GET /features/slug.json
      def show
        @feature = Feature.slug_and_name(params[:slug]).first

        render json: @feature
      end
    end
  end
end