filmov
tv
Sign In Anywhere with Devise - Ruby on Rails
Показать описание
====================
The Devise gem ships with a default configuration that allows you to sign in on a specific route. This post address the idea of changing that guideline to allow a user to sign in anywhere.
### Initial Setup
Configuring Devise is one of those time savers that my application template takes care of for me. I also extend the `User` model to include `name`, `username`, and `admin` attributes. These don't come by default with Devise.
All this is to say you're welcome to use my template or roll a new Rails app from scratch. In the video, you'll see me reference my template specifically.
### Extending Devise logic
The easiest way to allow your login form to appear elsewhere in a given Ruby on Rails application is to include some methods that Devise depends on when rendering its forms. If you installed the devise views as I have you can see inside `app/views/devise/sessions` there is a template for rendering the login form specifically.
====================
📰 One-click Subscribe:
💎🛤 NEW COURSE: HELLO RAILS
💻 Previously published at:
💻 Check out the blog:
🦄 Check out my personal site:
🚀 Links:
📘Check out my book on UX Design:
"LUXD: Learn User Experience Design"
📙 Check out my FREE book on Tumblr Theming:
"Pro Tumblr Theming"
💯 Need awesome web hosting? Check out cloudways. They allow me to use a variety of hosting providers and build apps with ease:
🌊 Need more advanced hosting for Rails, PHP, Node, or other projects? Digital Ocean has you covered.
☕️ Keep me awake. Buy me a coffee
Комментарии