Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Devise - taking care of your users
Search
Andreas Bjärlestam
February 22, 2011
Technology
80
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
More Decks by Andreas Bjärlestam
See All by Andreas Bjärlestam
Climate compensate with a pull request
bjarlestam
0
62
Agile performance testing
bjarlestam
0
120
SPDY and HTTP2
bjarlestam
1
1.4k
SPDY or maybe HTTP2.0
bjarlestam
4
71
jquery mobile
bjarlestam
0
77
REST with JAX-RS
bjarlestam
1
98
REST
bjarlestam
2
180
Other Decks in Technology
See All in Technology
ストレスなくAIと付き合いたい!こんなときどうしてる?
namiki64
3
510
二歩目のフロントエンド・ウェブアクセシビリティ
camiha
2
570
⾮構造化データを価値に変える AI エージェント基盤とその組織
ivry_presentationmaterials
0
190
事業成長とデータ活用を止めないためのマネジメントへ挑戦
hiracky16
0
390
go-sqletch
moznion
0
140
hackers_champloo_2026_tidb
makocchi
0
160
会社説明資料
persolserverworks
0
9.8k
Claude の新機能を、 出た日に触って社内に届けるまで
rfdnxbro
1
180
Classmethod Company Deck
satoshi7
1
680
DevelopersIO 2026 知識の地図を描く ─ オントロジーとは何か?
ishikawa_satoru
1
1.7k
サブエージェントと Claude Mods で作る独自 Advisor ツールの話
kenichiodo
2
160
しろおびから始める!ログ活用の第一歩
shumei_ito
0
950
Featured
See All Featured
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
850
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
320
A better future with KSS
kneath
240
18k
How to make the Groovebox
asonas
2
2.5k
Ten Tips & Tricks for a 🌱 transition
stuffmc
1
270
Java REST API Framework Comparison - PWX 2021
mraible
34
9.8k
Typedesign – Prime Four
hannesfritz
42
3.2k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
1k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
990
Product Roadmaps are Hard
iamctodd
55
13k
WCS-LA-2024
lcolladotor
0
890
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