我有一個註冊機制,通過確認鏈接激活後完成。現在我想刪除可確認的,我希望用戶在註冊後直接登錄。請告訴我需要做些什麼改變,我該如何做?我是否也需要從數據庫中刪除確認字段?請告訴我整個過程。註冊並直接登錄軌道3設計?
0
A
回答
0
在將用戶保存到db之前,您需要使用@user.skip_confirmation!
。 如果你使用的是registration_controller,那麼@user對象就像資源一樣。
這是registrations_controller的創建方法。
def create
build_resource
resource.skip_confirmation!
if resource.save
if resource.active_for_authentication?
set_flash_message :notice, :signed_up if is_navigational_format?
sign_in(resource_name, resource)
respond_with resource, :location => redirect_location(resource_name, resource)
else
set_flash_message :notice, :inactive_signed_up, :reason => inactive_reason(resource) if is_navigational_format?
expire_session_data_after_sign_in!
respond_with resource, :location => after_inactive_sign_up_path_for(resource)
end
else
clean_up_passwords(resource)
respond_with_navigational(resource) { render_with_scope :new }
end
end
0
只需從用戶模型中刪除可確認的模塊。
devise :confirmable, …
+0
以及我已經做了這一點,但它不工作,即使是現在我的註冊頁面未簽約..... –
相關問題
- 1. 登錄/直接在主頁上註冊
- 2. 軌道設計註冊或登錄,如果電子郵件已經採取
- 3. 註冊後立即禁止登錄(設計導軌)
- 4. 設計第一次登錄軌道
- 5. 設計登錄根路線導軌3
- 6. 如何註冊設計登錄事件?
- 7. 設計註冊自動登錄用戶
- 8. Rails自定義設計登錄/註冊
- 9. 註冊後與設計登錄
- 10. 設計:註冊登錄嘗試
- 11. 設計註冊成功,登錄失敗
- 12. 設計靈感:登錄/註冊形式
- 13. 登錄並註冊主頁
- 14. cakephp 2.1註冊並登錄
- 15. 重新定向後註冊並登錄2模型(設計)
- 16. 設計登錄並使用單個表單註冊
- 17. 試圖添加驗證到軌道設計註冊頁面
- 18. 錯重定向後註冊失敗,設計2.0和3.2.3軌道
- 19. 軌道4&設計 - 生成歡迎後,當新用戶註冊
- 20. 設計軌道4註冊插入空白配置文件
- 21. 電子郵件只註冊使用設計與軌道
- 22. 軌道4和設計 - 通過JSON API用戶註冊
- 23. 設計註冊記憶控制器santize_for_mass_assignment錯誤軌道4
- 24. 紅寶石軌道 - 設計註冊空白密碼
- 25. 惰性註冊 - 軌道
- 26. 使用設計註冊,登錄和註銷與iOS應用
- 27. HTTP登錄軌道?
- 28. devise登錄軌3
- 29. 註冊和登錄
- 30. PHP登錄/註冊
它的工作原理,但我不想因爲我不是凍結在registeration的控制人變更設計寶石,是否有任何其他方式,以便我可以從我的應用程序中刪除可確認? –
其他可能的解決方案是:你可以從user.rb模型中刪除可確認的。然後刪除數據庫 - 創建數據庫 - 然後遷移和C無論代碼工作與否... –