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
31
Agile performance testing
bjarlestam
0
110
SPDY and HTTP2
bjarlestam
1
1.2k
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
AWS アーキテクチャ作図入門/aws-architecture-diagram-101
ma2shita
29
11k
本が全く読めなかった過去の自分へ
genshun9
0
340
Clineを含めたAIエージェントを 大規模組織に導入し、投資対効果を考える / Introducing AI agents into your organization
i35_267
4
1.6k
米国国防総省のDevSecOpsライフサイクルをAWSのセキュリティサービスとOSSで実現
syoshie
2
1.1k
エンジニア向け技術スタック情報
kauche
1
250
PHP開発者のためのSOLID原則再入門 #phpcon / PHP Conference Japan 2025
shogogg
4
730
20250625 Snowflake Summit 2025活用事例 レポート / Nowcast Snowflake Summit 2025 Case Study Report
kkuv
1
310
BigQuery Remote FunctionでLooker Studioをインタラクティブ化
cuebic9bic
3
290
Javaで作る RAGを活用した Q&Aアプリケーション
recruitengineers
PRO
1
110
Liquid Glass革新とSwiftUI/UIKit進化
fumiyasac0921
0
210
“社内”だけで完結していた私が、AWS Community Builder になるまで
nagisa53
1
390
Snowflake Summit 2025 データエンジニアリング関連新機能紹介 / Snowflake Summit 2025 What's New about Data Engineering
tiltmax3
0
310
Featured
See All Featured
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
10
930
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Testing 201, or: Great Expectations
jmmastey
42
7.5k
Code Review Best Practice
trishagee
68
18k
GraphQLの誤解/rethinking-graphql
sonatard
71
11k
Stop Working from a Prison Cell
hatefulcrawdad
270
20k
Embracing the Ebb and Flow
colly
86
4.7k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
233
17k
4 Signs Your Business is Dying
shpigford
184
22k
Reflections from 52 weeks, 52 projects
jeffersonlam
351
20k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
Scaling GitHub
holman
459
140k
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