Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
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
71
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
30
Agile performance testing
bjarlestam
0
110
SPDY and HTTP2
bjarlestam
1
1.1k
SPDY or maybe HTTP2.0
bjarlestam
4
61
jquery mobile
bjarlestam
0
69
REST with JAX-RS
bjarlestam
1
89
REST
bjarlestam
2
170
Other Decks in Technology
See All in Technology
Postman Flowsの基本 / Postman Flows Basics
yokawasa
1
100
Building Products in the LLM Era
ymatsuwitter
10
5k
Larkご案内資料
customercloud
PRO
0
650
7日間でハッキングをはじめる本をはじめてみませんか?_ITエンジニア本大賞2025
nomizone
2
1.7k
N=1から解き明かすAWS ソリューションアーキテクトの魅力
kiiwami
0
110
【Developers Summit 2025】プロダクトエンジニアから学ぶ、 ユーザーにより高い価値を届ける技術
niwatakeru
2
1.2k
Amazon S3 Tablesと外部分析基盤連携について / Amazon S3 Tables and External Data Analytics Platform
nttcom
0
120
AndroidデバイスにFTPサーバを建立する
e10dokup
0
240
10分で紹介するAmazon Bedrock利用時のセキュリティ対策 / 10-minutes introduction to security measures when using Amazon Bedrock
hideakiaoyagi
0
180
あれは良かった、あれは苦労したB2B2C型SaaSの新規開発におけるCloud Spanner
hirohito1108
2
370
利用終了したドメイン名の最強終活〜観測環境を育てて、分析・供養している件〜 / The Ultimate End-of-Life Preparation for Discontinued Domain Names
nttcom
1
120
データの品質が低いと何が困るのか
kzykmyzw
6
1.1k
Featured
See All Featured
Git: the NoSQL Database
bkeepers
PRO
427
64k
KATA
mclloyd
29
14k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Agile that works and the tools we love
rasmusluckow
328
21k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.4k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7.1k
StorybookのUI Testing Handbookを読んだ
zakiyama
28
5.5k
Scaling GitHub
holman
459
140k
Adopting Sorbet at Scale
ufuk
74
9.2k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
Speed Design
sergeychernyshev
26
790
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