class UsersController < ApplicationController
  load_and_authorize_resource
  before_action { @navbar = "Users" }

  def index
    @users = @users.page(params[:page]).order("id")
  end

  def new
  end

  def create
    @user.save
    respond_with @user, location: ok_url_or_default([User])
  end

  def show
  end

  def edit
  end

  def update
    @user.update(user_params)
    respond_with @user, location: ok_url_or_default([User])
  end

  def destroy
    @user.delete
    respond_with @user, location: ok_url_or_default([User])
  end

  protected

  def user_params
    params.fetch(:user, {}).permit(:email, :password, :password_confirmation)
  end

end
class UsersController < ApplicationController
  load_and_authorize_resource
  before_action { @navbar = "Users" }

  def index
    @users = @users.page(params[:page]).order("id")
  end

  def new
  end

  def create
    @user.save
    respond_with @user, location: ok_url_or_default([User])
  end

  def show
  end

  def edit
  end

  def update
    @user.update(user_params)
    respond_with @user, location: ok_url_or_default([User])
  end

  def destroy
    @user.delete
    respond_with @user, location: ok_url_or_default([User])
  end

  protected

  def user_params
    params.fetch(:user).permit(:email, :password, :password_confirmation)
  end

end
Revert "add {} in user params.fetch"
Revert "add {} in user params.fetch"

This reverts commit b5f12c39c4b962cb28787d45ffd08fb601c19c32.
