lib/generators/admin/install/templates/controllers/admin/users_controller.rb in administration-zero-0.0.9 vs lib/generators/admin/install/templates/controllers/admin/users_controller.rb in administration-zero-0.0.10
- old
+ new
@@ -1,10 +1,10 @@
class Admin::UsersController < Admin::ApplicationController
before_action :set_admin_user, only: %i[ show edit update destroy ]
def index
- @search = AdminUser.all.ransack(params[:q])
+ @search = Admin::User.all.ransack(params[:q])
respond_to do |format|
format.html { @pagy, @admin_users = pagy(@search.result) }
format.csv { render csv: @search.result }
end
@@ -12,18 +12,18 @@
def show
end
def new
- @admin_user = AdminUser.new
+ @admin_user = Admin::User.new
end
def edit
end
def create
- @admin_user = AdminUser.new(admin_user_params)
+ @admin_user = Admin::User.new(admin_user_params)
if @admin_user.save
redirect_to @admin_user, notice: "User was successfully created."
else
render :new, status: :unprocessable_entity
@@ -43,10 +43,10 @@
redirect_to admin_users_url, notice: "User was successfully destroyed."
end
private
def set_admin_user
- @admin_user = AdminUser.find(params[:id])
+ @admin_user = Admin::User.find(params[:id])
end
def admin_user_params
params.require(:admin_user).permit(:email, :password, :password_confirmation)
end