Sha256: 2c67e3156950f78f31e0ee2a2ce74fce7b0e354f3670a8520bdf36154e3ff9a5

Contents?: true

Size: 379 Bytes

Versions: 4

Compression:

Stored size: 379 Bytes

Contents

class UsersController < ApplicationController
  before_action :set_user, only: [:show]

  # GET /users
  def index
    render json: {
      users: User.all
    }
  end

  # GET /users/:id
  def show
    render json: @user
  end

  private
    # Use callbacks to share common setup or constraints between actions.
    def set_user
      @user = User.find(params[:id])
    end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
activity_notification-2.1.3 spec/rails_app/app/controllers/users_controller.rb
activity_notification-2.1.2 spec/rails_app/app/controllers/users_controller.rb
activity_notification-2.1.1 spec/rails_app/app/controllers/users_controller.rb
activity_notification-2.1.0 spec/rails_app/app/controllers/users_controller.rb