module Api::V1
  class PositionsController < ApiController
    def index
      @positions = Position.all
      render json:  @positions
    end

    def show
      @position = Position.find(params[:id])
      render json: @position
    end

    def create
      @position = Position.new(position_params)

      if @position.save
        render json: @position
      else
        render json: @position.errors.to_json, status: 422
      end
    end

    def update
      @position = Position.find(params[:id])

      if @position.update(position_params)
        render json: @position
      else
        render json: @position.errors.to_json, status: 422
      end

    end

  private
    def position_params
      params.require(:position).permit([
        :name,
        :description
      ])
    end

  end
end

module Api::V1
  class PositionsController < ApiController
    def index
      @positions = Position.all
      render json:  @positions
    end

    def show
      @position = Position.find(params[:id])
      render json: @position
    end

    def create
      @position = Position.new(position_params)

      if @position.save
        render json: @position
      else
        render json: @position.errors.to_json, status: 422
      end
    end

    def update
      @position = Position.find(params[:id])

      if @position.update(position_params)
        render json: @position
      else
        render json: @position.errors.to_json, status: 422
      end

    end

  private
    def position_params
      params.require(:position).permit([
        :name,
        :description,
        :group_id,
        :paradigm
      ])
    end

  end
end

Add description, group_id, and paradigm to position API controller
Add description, group_id, and paradigm to position API controller

Signed-off-by: Max Fierke <0706025b2bbcec1ed8d64822f4eccd96314938d0@maxfierke.com>
