refactor: ⚡ Modal layout and turbolinks optimization
Reload with turbolinks, error messages, confirm password validation Login and Signup modals
This commit is contained in:
@@ -2,12 +2,16 @@
|
||||
|
||||
class UsersController < ApplicationController
|
||||
def create
|
||||
if user_params[:password] != params[:user][:confirm_password]
|
||||
return render json: { password: ['Password not match with Confirm Password'] }, status: :bad_request
|
||||
end
|
||||
|
||||
@user = User.create(user_params)
|
||||
if @user.errors.any?
|
||||
render json: @user.errors, status: :unprocessable_entity
|
||||
else
|
||||
session[:user_id] = @user.id
|
||||
redirect_to '/'
|
||||
render json: nil, status: :ok
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user