rootstrap/rails_api_base

View on GitHub
app/controllers/api/v1/users_controller.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
# frozen_string_literal: true

module API
  module V1
    class UsersController < API::V1::APIController
      def show
        authorize current_user
      end

      def update
        authorize current_user
        current_user.update!(update_user_params)
        render :show
      end

      private

      def update_user_params
        params.require(:user).permit(:username, :first_name, :last_name, :email)
      end
    end
  end
end