Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Devise - taking care of your users
Search
Andreas Bjärlestam
February 22, 2011
Technology
0
73
Devise - taking care of your users
A quick intro to the Devise, the signup module for Ruby on Rails
Andreas Bjärlestam
February 22, 2011
Tweet
Share
More Decks by Andreas Bjärlestam
See All by Andreas Bjärlestam
Climate compensate with a pull request
bjarlestam
0
34
Agile performance testing
bjarlestam
0
110
SPDY and HTTP2
bjarlestam
1
1.2k
SPDY or maybe HTTP2.0
bjarlestam
4
64
jquery mobile
bjarlestam
0
71
REST with JAX-RS
bjarlestam
1
91
REST
bjarlestam
2
170
Other Decks in Technology
See All in Technology
mairuでつくるクレデンシャルレス開発環境 / Credential-less development environment using Mailru
mirakui
5
540
大企業でもできる!ボトムアップで拡大させるプラットフォームの作り方
findy_eventslides
1
820
シニアソフトウェアエンジニアになるためには
kworkdev
PRO
3
170
SSO方式とJumpアカウント方式の比較と設計方針
yuobayashi
7
690
AI駆動開発の実践とその未来
eltociear
0
120
30分であなたをOmniのファンにしてみせます~分析画面のクリック操作をそのままコード化できるAI-ReadyなBIツール~
sagara
0
180
Reinforcement Fine-tuning 基礎〜実践まで
ch6noota
0
190
文字列の並び順 / Unicode Collation
tmtms
3
600
ディメンショナルモデリングを支えるData Vaultについて
10xinc
1
100
会社紹介資料 / Sansan Company Profile
sansan33
PRO
11
390k
SQLだけでマイグレーションしたい!
makki_d
0
220
Jakarta Agentic AI Specification - Status and Future
reza_rahman
0
110
Featured
See All Featured
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Testing 201, or: Great Expectations
jmmastey
46
7.8k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
The Pragmatic Product Professional
lauravandoore
37
7.1k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
54k
We Have a Design System, Now What?
morganepeng
54
7.9k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.6k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
196
70k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.2k
Building Adaptive Systems
keathley
44
2.9k
How to Ace a Technical Interview
jacobian
281
24k
Transcript
Devise Taking care of your users Andreas Bjärlestam! 2011-02-22!
Andreas Bjärlestam mailto:
[email protected]
http://twitter.com/bjarlestam
So you are building a site with rails?
Hopefully you will have some users lining up...
They will probably f#&k things up USER USER STUPID
This could require quite some coding Signup page Login page
Account confirmation mails Password reset mails Password reset page Checks and redirects
You?
What to do?
DEVISE can do it!
DEVISE • User authentication • User signup • Account confirmaiton
• Password recovery • Remembering via cookie • Session expiration • Account locking http://github.com/plataformatec/devise
Lets code…
Create a rails project $>rails new devise_test $>cd devise_test $>gem
install devise $>echo "gem 'devise'" >> Gemfile $>rails generate devise:install $>cat config/routes.rb | sed s/'# root :to'/'root :to'/ >> config/routes.rb
Create a User model $>rails generate devise User $>rake db:migrate
Test it $>rails server $>open http://localhost:3000/users/sign_up $>open http://localhost:3000/users/sign_in $>open http://localhost:3000/users/sign_out
None
What happened?
configuration Configured routes config/routes.rb devise_for :users Configuration file and localization
config/initializers/devise.rb config/initializers/locales/devise.en.yml
User model class User < ActiveRecord::Base # Include default devise
modules. Others available are: # :token_authenticatable, :confirmable, :lockable and :timeoutable devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable # Setup accessible (or protected) attributes for your model attr_accessible :email, :password, :password_confirmation, :remember_me end
helpers available before_filter :authenticate_user! user_signed_in? current_user
customize views $>rails generate devise:views create app/views/devise create app/views/devise/confirmations/new.html.erb create
app/views/devise/mailer/confirmation_instructions.html.erb create app/views/devise/mailer/reset_password_instructions.html.erb create app/views/devise/mailer/unlock_instructions.html.erb create app/views/devise/passwords/edit.html.erb create app/views/devise/passwords/new.html.erb create app/views/devise/registrations/edit.html.erb create app/views/devise/registrations/new.html.erb create app/views/devise/sessions/new.html.erb create app/views/devise/shared/_links.erb create app/views/devise/unlocks/new.html.erb
None
Attributions • http://www.flickr.com/photos/weelakeo/3815108314/ • http://www.flickr.com/photos/nikio/3899114449/ • http://www.flickr.com/photos/zigazou76/3636704536/ • http://www.flickr.com/photos/myklroventine-events/3832058915/ •
http://www.flickr.com/photos/cokaigne/1401246909/ • http://www.flickr.com/photos/alpha/5434014952 • http://www.flickr.com/photos/alpha/5433405433