Sha256: 8253c805a3f1b44181b9ade173410e8fc9d57a7c151c38e87f661b5ae82717ce

Contents?: true

Size: 470 Bytes

Versions: 10

Compression:

Stored size: 470 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

  # GET /users/find
  def find
    render json: User.find_by_email!(params[:email])
  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

10 entries across 10 versions & 1 rubygems

Version Path
activity_notification-2.3.3 spec/rails_app/app/controllers/users_controller.rb
activity_notification-2.3.2 spec/rails_app/app/controllers/users_controller.rb
activity_notification-2.3.1 spec/rails_app/app/controllers/users_controller.rb
activity_notification-2.3.0 spec/rails_app/app/controllers/users_controller.rb
activity_notification-2.2.4 spec/rails_app/app/controllers/users_controller.rb
activity_notification-2.2.3 spec/rails_app/app/controllers/users_controller.rb
activity_notification-2.2.2 spec/rails_app/app/controllers/users_controller.rb
activity_notification-2.2.1 spec/rails_app/app/controllers/users_controller.rb
activity_notification-2.2.0 spec/rails_app/app/controllers/users_controller.rb
activity_notification-2.1.4 spec/rails_app/app/controllers/users_controller.rb