我的問題其實很簡單,我如何做一個創建操作,檢查用戶是否登錄,如果她/他然後重定向到儀表板而不是呈現索引頁在哪裏他們有鏈接和東西去註冊。此外,爲什麼下面的代碼無法正常工作。使用重定向和如果多次
類UsersController < ApplicationController的
def new
@user = User.new
end
def create
if current_user.nil?
redirect_to dplace_index_path
if current_user
@user = User.new(params[:user])
if @user.save
auto_login(@user)
redirect_to dplace_index_path
end
end
end
end
end
你得到的錯誤是什麼? –