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
62
jquery mobile
bjarlestam
0
70
REST with JAX-RS
bjarlestam
1
89
REST
bjarlestam
2
170
Other Decks in Technology
See All in Technology
dbt開発 with Claude Codeのためのガードレール設計
10xinc
2
1.2k
機械学習を扱うプラットフォーム開発と運用事例
lycorptech_jp
PRO
0
250
CDK CLIで使ってたあの機能、CDK Toolkit Libraryではどうやるの?
smt7174
4
180
「Linux」という言葉が指すもの
sat
PRO
4
130
Language Update: Java
skrb
2
300
Snowflake Intelligenceにはこうやって立ち向かう!クラシルが考えるAI Readyなデータ基盤と活用のためのDataOps
gappy50
0
240
KotlinConf 2025_イベントレポート
sony
1
140
研究開発と製品開発、両利きのロボティクス
youtalk
1
530
企業の生成AIガバナンスにおけるエージェントとセキュリティ
lycorptech_jp
PRO
2
170
JTCにおける内製×スクラム開発への挑戦〜内製化率95%達成の舞台裏/JTC's challenge of in-house development with Scrum
aeonpeople
0
230
Practical Agentic AI in Software Engineering
uzyn
0
110
【NoMapsTECH 2025】AI Edge Computing Workshop
akit37
0
170
Featured
See All Featured
Automating Front-end Workflow
addyosmani
1370
200k
Building Better People: How to give real-time feedback that sticks.
wjessup
368
19k
How GitHub (no longer) Works
holman
315
140k
Designing Experiences People Love
moore
142
24k
The Pragmatic Product Professional
lauravandoore
36
6.9k
Building Applications with DynamoDB
mza
96
6.6k
Documentation Writing (for coders)
carmenintech
74
5k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
23
1.4k
What's in a price? How to price your products and services
michaelherold
246
12k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
9
810
Designing for Performance
lara
610
69k
Agile that works and the tools we love
rasmusluckow
330
21k
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