$30 off During Our Annual Pro Sale. View Details »
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
72
REST with JAX-RS
bjarlestam
1
91
REST
bjarlestam
2
170
Other Decks in Technology
See All in Technology
意外と知らない状態遷移テストの世界
nihonbuson
PRO
1
260
半年で、AIゼロ知識から AI中心開発組織の変革担当に至るまで
rfdnxbro
0
140
Lookerで実現するセキュアな外部データ提供
zozotech
PRO
0
200
AWSの新機能をフル活用した「re:Inventエージェント」開発秘話
minorun365
2
460
20251222_サンフランシスコサバイバル術
ponponmikankan
2
140
NIKKEI Tech Talk #41: セキュア・バイ・デザインからクラウド管理を考える
sekido
PRO
0
210
AI駆動開発ライフサイクル(AI-DLC)の始め方
ryansbcho79
0
190
AIエージェント開発と活用を加速するワークフロー自動生成への挑戦
shibuiwilliam
5
860
Agent Skillsがハーネスの垣根を超える日
gotalab555
6
4.4k
Amazon Quick Suite で始める手軽な AI エージェント
shimy
1
1.9k
Oracle Database@AWS:サービス概要のご紹介
oracle4engineer
PRO
1
410
テストセンター受験、オンライン受験、どっちなんだい?
yama3133
0
170
Featured
See All Featured
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.6k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.8k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
0
89
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
0
100
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.6k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.8k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
9
1k
Discover your Explorer Soul
emna__ayadi
2
1k
GraphQLとの向き合い方2022年版
quramy
50
14k
sira's awesome portfolio website redesign presentation
elsirapls
0
89
Build your cross-platform service in a week with App Engine
jlugia
234
18k
The Limits of Empathy - UXLibs8
cassininazir
1
190
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