Learning Devise for Rails
暫譯: Rails 的 Devise 學習指南
Hafiz Barie Lubis, Nia Mutiara, Giovanni Sakti
- 出版商: Packt Publishing
- 出版日期: 2013-10-25
- 售價: $1,360
- 貴賓價: 9.5 折 $1,292
- 語言: 英文
- 頁數: 104
- 裝訂: Paperback
- ISBN: 1782167048
- ISBN-13: 9781782167044
-
相關分類:
Ruby
海外代購書籍(需單獨結帳)
相關主題
商品描述
In choosing a fully-featured user sign-in system for your Rails web applications you can't do better than Devise. And there's no better book for learning Devise than this superb step-by-step tutorial.
Overview
- Use Devise to implement an e-mail-based sign-in process in a few minutes
- Override Devise controllers to allow username-based sign-ins, and customize default Devise HTML views to change the look and feel of the authentication system
- Test your authentication codes to ensure stability
In Detail
There are numerous ways of implementing user sign-ins on your Rails web applications. Of those different ways, using Devise is one of the most popular, quick and flexible way to get user sign-ins working. It is extensible and plays well with other gems such as CanCan (for user privileges) and OmniAuth (for Facebook and Twitter sign-ins).
A hands-on, all-in-one guide that gives you step-by-step instructions along with code examples to implement authentication systems in your application. This book will help you to implement various schemes of authentication systems including authorization and remote authentication, using Devise.
Helping you make your Rails applications more accessible and user-friendly; this book explains how to implement user sign-ins in Rails. It will also show you how to customize user authentication pages, such as sign-in, sign-up, forgot password, and account details, by making use of existing Devise views. In addition, you will learn about facilitating complex privilege rules using the CanCan gem. Finally, you will discover how to make sure your authentication codes work as expected by using integration tests.
You will learn all you need to know to create user email and social network sign-ins quickly, to customize user sign-in-related views, and implement complex privileges, as well as to ensure the stability of your authentication codes by testing them.
What you will learn from this book
- Understand Devise as a flexible and customizable authentication solution for Rails
- Customize sign-in, sign-up, password reset, email confirmation, account cancellation, and user account edit pages
- Hide and show views based on defined user authorization rules using CanCan view helpers
- Configure OmniAuth to make user sign-ins and sign-ups via social network accounts work on your Rails application
- Use CanCan abilities to implement simple and SQL-based user privileges to restrict user access
- Test authentications to ensure code stability
Approach
A hands-on, step-by-step guide to using Devise for authentication in Rails.
Who this book is written for
If you are a web developer who is getting started with Rails and you are looking for authentication solutions, then this is the book for you. If you are a current Rails developer who is looking to extend your authentication implementation with capabilities such as authorization and remote authentication, this book will also be great for you.
商品描述(中文翻譯)
在為您的 Rails 網頁應用程式選擇一個功能齊全的用戶登入系統時,Devise 是最佳選擇。而學習 Devise 的最佳書籍就是這本出色的逐步教程。
**概述**
- 使用 Devise 在幾分鐘內實現基於電子郵件的登入流程
- 覆寫 Devise 控制器以允許基於用戶名的登入,並自定義默認的 Devise HTML 視圖以改變身份驗證系統的外觀和感覺
- 測試您的身份驗證代碼以確保穩定性
**詳細內容**
在您的 Rails 網頁應用程式中,有許多實現用戶登入的方法。在這些不同的方法中,使用 Devise 是最受歡迎、快速且靈活的方式之一,可以讓用戶登入功能正常運作。它具有可擴展性,並且能與其他 gem(如 CanCan 用於用戶權限和 OmniAuth 用於 Facebook 和 Twitter 登入)良好協作。
這是一本實用的全方位指南,提供逐步的指導和代碼範例,以在您的應用程式中實現身份驗證系統。本書將幫助您使用 Devise 實現各種身份驗證系統的方案,包括授權和遠程身份驗證。
本書幫助您使您的 Rails 應用程式更具可訪問性和用戶友好性;它解釋了如何在 Rails 中實現用戶登入。它還將向您展示如何通過利用現有的 Devise 視圖來自定義用戶身份驗證頁面,例如登入、註冊、忘記密碼和帳戶詳細資訊。此外,您將學習如何使用 CanCan gem 來促進複雜的權限規則。最後,您將發現如何通過使用整合測試來確保您的身份驗證代碼按預期工作。
您將學到所有需要的知識,以快速創建用戶電子郵件和社交網絡登入,定制與用戶登入相關的視圖,實現複雜的權限,並通過測試來確保身份驗證代碼的穩定性。
**您將從本書中學到什麼**
- 理解 Devise 作為 Rails 的靈活且可自定義的身份驗證解決方案
- 自定義登入、註冊、密碼重置、電子郵件確認、帳戶取消和用戶帳戶編輯頁面
- 根據定義的用戶授權規則使用 CanCan 視圖助手隱藏和顯示視圖
- 配置 OmniAuth 以使社交網絡帳戶的用戶登入和註冊在您的 Rails 應用程式中正常運作
- 使用 CanCan 能力實現簡單和基於 SQL 的用戶權限以限制用戶訪問
- 測試身份驗證以確保代碼穩定性
**方法**
一本實用的逐步指南,教您如何在 Rails 中使用 Devise 進行身份驗證。
**本書的讀者對象**
如果您是一位剛開始接觸 Rails 的網頁開發者,並且正在尋找身份驗證解決方案,那麼這本書就是為您而寫的。如果您是一位現有的 Rails 開發者,想要擴展您的身份驗證實現,增加授權和遠程身份驗證等功能,這本書也將非常適合您。