Skip to content
This repository
Newer
Older
100644 389 lines (246 sloc) 16.855 kb
bb6d89bb »
2012-01-30 Change README do markdown
1 ## Devise
673fda97 »
2009-09-16 First commit.
2
59a95764 »
2012-05-29 Add Code Climate badge to README
3 [![Build Status](https://secure.travis-ci.org/plataformatec/devise.png)](http://travis-ci.org/plataformatec/devise) [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/plataformatec/devise)
538c16cd »
2011-11-06 Added CI status to the README
4
9e096a41 »
2012-09-18 Update README.md
5 This README is [also available in a friendly navigable format](http://devise.plataformatec.com.br/).
6
493f91fd »
2009-10-13 Readme updates.
7 Devise is a flexible authentication solution for Rails based on Warden. It:
8
9 * Is Rack based;
10 * Is a complete MVC solution based on Rails engines;
11 * Allows you to have multiple roles (or models/scopes) signed in at the same time;
12 * Is based on a modularity concept: use just what you really need.
13
b6c7aafe »
2012-05-20 Simple compose VS comprise grammar fix.
14 It's composed of 12 modules:
493f91fd »
2009-10-13 Readme updates.
15
d1938026 »
2012-05-10 Added links to module RDocs, except for Encryptable which I couldn't …
16 * [Database Authenticatable](http://rubydoc.info/github/plataformatec/devise/master/Devise/Models/DatabaseAuthenticatable): encrypts and stores a password in the database to validate the authenticity of a user while signing in. The authentication can be done both through POST requests or HTTP Basic Authentication.
17 * [Token Authenticatable](http://rubydoc.info/github/plataformatec/devise/master/Devise/Models/TokenAuthenticatable): signs in a user based on an authentication token (also known as "single access token"). The token can be given both through query string or HTTP Basic Authentication.
dbea9347 »
2012-05-29 Update README.md [ci skip]
18 * [Omniauthable](http://rubydoc.info/github/plataformatec/devise/master/Devise/Models/Omniauthable): adds Omniauth (https://github.com/intridea/omniauth) support;
d1938026 »
2012-05-10 Added links to module RDocs, except for Encryptable which I couldn't …
19 * [Confirmable](http://rubydoc.info/github/plataformatec/devise/master/Devise/Models/Confirmable): sends emails with confirmation instructions and verifies whether an account is already confirmed during sign in.
20 * [Recoverable](http://rubydoc.info/github/plataformatec/devise/master/Devise/Models/Recoverable): resets the user password and sends reset instructions.
21 * [Registerable](http://rubydoc.info/github/plataformatec/devise/master/Devise/Models/Registerable): handles signing up users through a registration process, also allowing them to edit and destroy their account.
22 * [Rememberable](http://rubydoc.info/github/plataformatec/devise/master/Devise/Models/Rememberable): manages generating and clearing a token for remembering the user from a saved cookie.
23 * [Trackable](http://rubydoc.info/github/plataformatec/devise/master/Devise/Models/Trackable): tracks sign in count, timestamps and IP address.
24 * [Timeoutable](http://rubydoc.info/github/plataformatec/devise/master/Devise/Models/Timeoutable): expires sessions that have no activity in a specified period of time.
25 * [Validatable](http://rubydoc.info/github/plataformatec/devise/master/Devise/Models/Validatable): provides validations of email and password. It's optional and can be customized, so you're able to define your own validations.
26 * [Lockable](http://rubydoc.info/github/plataformatec/devise/master/Devise/Models/Lockable): locks an account after a specified number of failed sign-in attempts. Can unlock via email or after a specified time period.
673fda97 »
2009-09-16 First commit.
27
bb6d89bb »
2012-01-30 Change README do markdown
28 ## Information
493f91fd »
2009-10-13 Readme updates.
29
bb6d89bb »
2012-01-30 Change README do markdown
30 ### The Devise wiki
2fe1a69b »
2009-10-21 Added jeweler to rakefile and version.
31
fdb4cd5b »
2010-09-22 Major update to README - encourage use of the Wiki
32 The Devise Wiki has lots of additional information about Devise including many "how-to" articles and answers to the most frequently asked questions. Please browse the Wiki after finishing this README:
84c34ff0 »
2010-06-28 Be more specific about master.
33
13ed2183 »
2011-10-13 many typos (http -> https)
34 https://wiki.github.com/plataformatec/devise
6f450d7a »
2009-10-21 Fix requiring devise mapping, and adding some documentation about rou…
35
bb6d89bb »
2012-01-30 Change README do markdown
36 ### Bug reports
3432c9ee »
2009-12-12 Simplify autoload stack.
37
fdb4cd5b »
2010-09-22 Major update to README - encourage use of the Wiki
38 If you discover a problem with Devise, we would like to know about it. However, we ask that you please review these guidelines before submitting a bug report:
7c82d3ee »
2010-05-21 Move the generator bit to the top.
39
13ed2183 »
2011-10-13 many typos (http -> https)
40 https://github.com/plataformatec/devise/wiki/Bug-reports
7c82d3ee »
2010-05-21 Move the generator bit to the top.
41
45aca40f »
2012-04-04 Updating the README since we won't have more private messages on Github
42 If you found a security bug, do *NOT* use the GitHub issue tracker. Send an email to the maintainers listed at the bottom of the README.
fdb4cd5b »
2010-09-22 Major update to README - encourage use of the Wiki
43
bb6d89bb »
2012-01-30 Change README do markdown
44 ### Mailing list
0bd75469 »
2010-04-05 Update README.
45
971f68f9 »
2011-01-15 README: Call the Google Group a mailing list; merge Testing section i…
46 If you have any questions, comments, or concerns, please use the Google Group instead of the GitHub issue tracker:
6d6633d1 »
2010-02-17 Release 1.1.pre which is Rails 3 compatible.
47
13ed2183 »
2011-10-13 many typos (http -> https)
48 https://groups.google.com/group/plataformatec-devise
fdb4cd5b »
2010-09-22 Major update to README - encourage use of the Wiki
49
bb6d89bb »
2012-01-30 Change README do markdown
50 ### RDocs
fdb4cd5b »
2010-09-22 Major update to README - encourage use of the Wiki
51
52 You can view the Devise documentation in RDoc format here:
53
54 http://rubydoc.info/github/plataformatec/devise/master/frames
6d6633d1 »
2010-02-17 Release 1.1.pre which is Rails 3 compatible.
55
b061f985 »
2012-01-27 Update README to remove reference to old migration helpers.
56 If you need to use Devise with Rails 2.3, you can always run "gem server" from the command line after you install the gem to access the old documentation.
6d6633d1 »
2010-02-17 Release 1.1.pre which is Rails 3 compatible.
57
bb6d89bb »
2012-01-30 Change README do markdown
58 ### Example applications
6d6633d1 »
2010-02-17 Release 1.1.pre which is Rails 3 compatible.
59
fdb4cd5b »
2010-09-22 Major update to README - encourage use of the Wiki
60 There are a few example applications available on GitHub that demonstrate various features of Devise with different versions of Rails. You can view them here:
6d6633d1 »
2010-02-17 Release 1.1.pre which is Rails 3 compatible.
61
13ed2183 »
2011-10-13 many typos (http -> https)
62 https://github.com/plataformatec/devise/wiki/Example-Applications
1db86a08 »
2010-04-15 More information about ecosystem in the README.
63
bb6d89bb »
2012-01-30 Change README do markdown
64 ### Extensions
1db86a08 »
2010-04-15 More information about ecosystem in the README.
65
fdb4cd5b »
2010-09-22 Major update to README - encourage use of the Wiki
66 Our community has created a number of extensions that add functionality above and beyond what is included with Devise. You can view a list of available extensions and add your own here:
1db86a08 »
2010-04-15 More information about ecosystem in the README.
67
13ed2183 »
2011-10-13 many typos (http -> https)
68 https://github.com/plataformatec/devise/wiki/Extensions
1db86a08 »
2010-04-15 More information about ecosystem in the README.
69
bb6d89bb »
2012-01-30 Change README do markdown
70 ### Contributing
fdb4cd5b »
2010-09-22 Major update to README - encourage use of the Wiki
71
72 We hope that you will consider contributing to Devise. Please read this short overview for some information about how to get started:
73
13ed2183 »
2011-10-13 many typos (http -> https)
74 https://github.com/plataformatec/devise/wiki/Contributing
fdb4cd5b »
2010-09-22 Major update to README - encourage use of the Wiki
75
b061f985 »
2012-01-27 Update README to remove reference to old migration helpers.
76 You will usually want to write tests for your changes. To run the test suite, go into Devise's top-level directory and run "bundle install" and "rake". For the tests to pass, you will need to have a MongoDB server (version 2.0 or newer) running on your system.
f96061b3 »
2010-09-24 Update docs and CHANGELOG based on the 1.1.3 release from v1.1 branch.
77
bb6d89bb »
2012-01-30 Change README do markdown
78 ## Starting with Rails?
5f93d835 »
2011-01-31 A tip for newcommers.
79
76a48004 »
2011-01-31 Words.
80 If you are building your first Rails application, we recommend you to *not* use Devise. Devise requires a good understanding of the Rails Framework. In such cases, we advise you to start a simple authentication system from scratch, today we have two resources:
5f93d835 »
2011-01-31 A tip for newcommers.
81
82 * Michael Hartl's online book: http://railstutorial.org/chapters/modeling-and-viewing-users-two#top
83 * Ryan Bates' Railscast: http://railscasts.com/episodes/250-authentication-from-scratch
84
762f3907 »
2011-07-11 quick typo fix
85 Once you have solidified your understanding of Rails and authentication mechanisms, we assure you Devise will be very pleasant to work with. :)
5f93d835 »
2011-01-31 A tip for newcommers.
86
bb6d89bb »
2012-01-30 Change README do markdown
87 ## Getting started
493f91fd »
2009-10-13 Readme updates.
88
dfcf8257 »
2012-01-27 Update README.doc to specify adding devise to the Gemfile.
89 Devise 2.0 works with Rails 3.1 onwards. You can add it to your Gemfile with:
cb285bf7 »
2009-10-15 Updating readme with missing migration info.
90
85e4a0e6 »
2012-04-04 Fixes syntax highlighting in the "Getting started" section of the README
91 ```ruby
92 gem 'devise'
93 ```
dfcf8257 »
2012-01-27 Update README.doc to specify adding devise to the Gemfile.
94
95 Run the bundle command to install it.
d26f90f7 »
2009-10-20 Updating docs and TODO.
96
b061f985 »
2012-01-27 Update README to remove reference to old migration helpers.
97 After you install Devise and add it to your Gemfile, you need to run the generator:
493f91fd »
2009-10-13 Readme updates.
98
bb6d89bb »
2012-01-30 Change README do markdown
99 ```console
100 rails generate devise:install
101 ```
493f91fd »
2009-10-13 Readme updates.
102
b061f985 »
2012-01-27 Update README to remove reference to old migration helpers.
103 The generator will install an initializer which describes ALL Devise's configuration options and you MUST take a look at it. When you are done, you are ready to add Devise to any of your models using the generator:
493f91fd »
2009-10-13 Readme updates.
104
bb6d89bb »
2012-01-30 Change README do markdown
105 ```console
106 rails generate devise MODEL
107 ```
493f91fd »
2009-10-13 Readme updates.
108
e345d394 »
2012-08-27 Minor typo fix
109 Replace MODEL by the class name used for the applications users, it's frequently 'User' but could also be 'Admin'. This will create a model (if one does not exist) and configure it with default Devise modules. Next, you'll usually run "rake db:migrate" as the generator will have created a migration file (if your ORM supports them). This generator also configures your config/routes.rb file to point to the Devise controller.
efc0ae23 »
2010-01-13 Deprecate :all.
110
61e85a57 »
2012-02-23 Include note about restarting the rails app if it's already running, …
111 Note that you should re-start your app here if you've already started it. Otherwise you'll run into strange errors like users being unable to login and the route helpers being undefined.
112
bb6d89bb »
2012-01-30 Change README do markdown
113 ### Controller filters and helpers
3209e7d9 »
2009-10-30 Renamed confirm_in to confirm_within.
114
5c59f4cd »
2010-02-27 Fixes to syntax, diction and spelling in README.
115 Devise will create some helpers to use inside your controllers and views. To set up a controller with user authentication, just add this before_filter:
493f91fd »
2009-10-13 Readme updates.
116
bb6d89bb »
2012-01-30 Change README do markdown
117 ```ruby
118 before_filter :authenticate_user!
119 ```
493f91fd »
2009-10-13 Readme updates.
120
5c59f4cd »
2010-02-27 Fixes to syntax, diction and spelling in README.
121 To verify if a user is signed in, use the following helper:
493f91fd »
2009-10-13 Readme updates.
122
bb6d89bb »
2012-01-30 Change README do markdown
123 ```ruby
124 user_signed_in?
125 ```
493f91fd »
2009-10-13 Readme updates.
126
5c59f4cd »
2010-02-27 Fixes to syntax, diction and spelling in README.
127 For the current signed-in user, this helper is available:
493f91fd »
2009-10-13 Readme updates.
128
bb6d89bb »
2012-01-30 Change README do markdown
129 ```ruby
130 current_user
131 ```
493f91fd »
2009-10-13 Readme updates.
132
5c59f4cd »
2010-02-27 Fixes to syntax, diction and spelling in README.
133 You can access the session for this scope:
cce3f58e »
2009-10-18 Fix typo and filter info in readme.
134
bb6d89bb »
2012-01-30 Change README do markdown
135 ```ruby
136 user_session
137 ```
cce3f58e »
2009-10-18 Fix typo and filter info in readme.
138
075fc96f »
2012-03-05 Fix formatting in README
139 After signing in a user, confirming the account or updating the password, Devise will look for a scoped root path to redirect. Example: For a :user resource, it will use `user_root_path` if it exists, otherwise default `root_path` will be used. This means that you need to set the root inside your routes:
6f450d7a »
2009-10-21 Fix requiring devise mapping, and adding some documentation about rou…
140
bb6d89bb »
2012-01-30 Change README do markdown
141 ```ruby
142 root :to => "home#index"
143 ```
6f450d7a »
2009-10-21 Fix requiring devise mapping, and adding some documentation about rou…
144
075fc96f »
2012-03-05 Fix formatting in README
145 You can also overwrite `after_sign_in_path_for` and `after_sign_out_path_for` to customize your redirect hooks.
d445b4be »
2009-11-19 Create after_sign_in_path_for and after_sign_out_path_for hooks and s…
146
b061f985 »
2012-01-27 Update README to remove reference to old migration helpers.
147 Finally, you need to set up default url options for the mailer in each environment. Here is the configuration for "config/environments/development.rb":
6f450d7a »
2009-10-21 Fix requiring devise mapping, and adding some documentation about rou…
148
bb6d89bb »
2012-01-30 Change README do markdown
149 ```ruby
150 config.action_mailer.default_url_options = { :host => 'localhost:3000' }
151 ```
fc08a7c5 »
2009-10-19 Changing resource_home_path to resource_root_path and add the same re…
152
67645c68 »
2010-11-15 Move extra helpers names to the bottom.
153 Notice that if your devise model is not called "user" but "member", then the helpers you should use are:
154
bb6d89bb »
2012-01-30 Change README do markdown
155 ```ruby
156 before_filter :authenticate_member!
67645c68 »
2010-11-15 Move extra helpers names to the bottom.
157
bb6d89bb »
2012-01-30 Change README do markdown
158 member_signed_in?
67645c68 »
2010-11-15 Move extra helpers names to the bottom.
159
bb6d89bb »
2012-01-30 Change README do markdown
160 current_member
67645c68 »
2010-11-15 Move extra helpers names to the bottom.
161
bb6d89bb »
2012-01-30 Change README do markdown
162 member_session
163 ```
67645c68 »
2010-11-15 Move extra helpers names to the bottom.
164
bb6d89bb »
2012-01-30 Change README do markdown
165 ### Configuring Models
fdb4cd5b »
2010-09-22 Major update to README - encourage use of the Wiki
166
b061f985 »
2012-01-27 Update README to remove reference to old migration helpers.
167 The devise method in your models also accepts some options to configure its modules. For example, you can choose the cost of the encryption algorithm with:
fdb4cd5b »
2010-09-22 Major update to README - encourage use of the Wiki
168
bb6d89bb »
2012-01-30 Change README do markdown
169 ```ruby
170 devise :database_authenticatable, :registerable, :confirmable, :recoverable, :stretches => 20
171 ```
fdb4cd5b »
2010-09-22 Major update to README - encourage use of the Wiki
172
09088706 »
2010-09-25 Extract encryptors into their own module for better bcrypt support.
173 Besides :stretches, you can define :pepper, :encryptor, :confirm_within, :remember_for, :timeout_in, :unlock_in and other values. For details, see the initializer file that was created when you invoked the "devise:install" generator described above.
fdb4cd5b »
2010-09-22 Major update to README - encourage use of the Wiki
174
bb6d89bb »
2012-01-30 Change README do markdown
175 ### Configuring multiple models
3209e7d9 »
2009-10-30 Renamed confirm_in to confirm_within.
176
b061f985 »
2012-01-27 Update README to remove reference to old migration helpers.
177 Devise allows you to set up as many roles as you want. For example, you may have a User model and also want an Admin model with just authentication and timeoutable features. If so, just follow these steps:
493f91fd »
2009-10-13 Readme updates.
178
bb6d89bb »
2012-01-30 Change README do markdown
179 ```ruby
180 # Create a migration with the required fields
181 create_table :admins do |t|
182 t.string :email
183 t.string :encrypted_password
184 t.timestamps
185 end
9feb9455 »
2009-10-18 Allow page after sign in to be configured.
186
bb6d89bb »
2012-01-30 Change README do markdown
187 # Inside your Admin model
188 devise :database_authenticatable, :timeoutable
9feb9455 »
2009-10-18 Allow page after sign in to be configured.
189
bb6d89bb »
2012-01-30 Change README do markdown
190 # Inside your routes
191 devise_for :admins
9feb9455 »
2009-10-18 Allow page after sign in to be configured.
192
bb6d89bb »
2012-01-30 Change README do markdown
193 # Inside your protected controller
194 before_filter :authenticate_admin!
9feb9455 »
2009-10-18 Allow page after sign in to be configured.
195
bb6d89bb »
2012-01-30 Change README do markdown
196 # Inside your controllers and views
197 admin_signed_in?
198 current_admin
199 admin_session
200 ```
493f91fd »
2009-10-13 Readme updates.
201
b061f985 »
2012-01-27 Update README to remove reference to old migration helpers.
202 On the other hand, you can simply run the generator!
203
bb6d89bb »
2012-01-30 Change README do markdown
204 ### Configuring views
efc0ae23 »
2010-01-13 Deprecate :all.
205
bf63824a »
2010-04-12 Improve wording in the README.
206 We built Devise to help you quickly develop an application that uses authentication. However, we don't want to be in your way when you need to customize it.
0a317c96 »
2009-10-23 README with some Generators info.
207
13bd4ce4 »
2012-01-11 Grammar fix.
208 Since Devise is an engine, all its views are packaged inside the gem. These views will help you get started, but after some time you may want to change them. If this is the case, you just need to invoke the following generator, and it will copy all views to your application:
0a317c96 »
2009-10-23 README with some Generators info.
209
bb6d89bb »
2012-01-30 Change README do markdown
210 ```console
211 rails generate devise:views
212 ```
efc0ae23 »
2010-01-13 Deprecate :all.
213
eb3118e8 »
2010-07-15 Add OAuth2 documentation.
214 If you have more than one role in your application (such as "User" and "Admin"), you will notice that Devise uses the same views for all roles. Fortunately, Devise offers an easy way to customize views. All you need to do is set "config.scoped_views = true" inside "config/initializers/devise.rb".
215
216 After doing so, you will be able to have views based on the role like "users/sessions/new" and "admins/sessions/new". If no view is found within the scope, Devise will use the default view at "devise/sessions/new". You can also use the generator to generate scoped views:
217
bb6d89bb »
2012-01-30 Change README do markdown
218 ```console
219 rails generate devise:views users
220 ```
f6cc2192 »
2010-02-17 Devise now allows you to have custom controlleers. Check the README f…
221
bb6d89bb »
2012-01-30 Change README do markdown
222 ### Configuring controllers
f6cc2192 »
2010-02-17 Devise now allows you to have custom controlleers. Check the README f…
223
bf63824a »
2010-04-12 Improve wording in the README.
224 If the customization at the views level is not enough, you can customize each controller by following these steps:
225
226 1) Create your custom controller, for example a Admins::SessionsController:
f6cc2192 »
2010-02-17 Devise now allows you to have custom controlleers. Check the README f…
227
bb6d89bb »
2012-01-30 Change README do markdown
228 ```ruby
229 class Admins::SessionsController < Devise::SessionsController
230 end
231 ```
f6cc2192 »
2010-02-17 Devise now allows you to have custom controlleers. Check the README f…
232
bf63824a »
2010-04-12 Improve wording in the README.
233 2) Tell the router to use this controller:
f6cc2192 »
2010-02-17 Devise now allows you to have custom controlleers. Check the README f…
234
bb6d89bb »
2012-01-30 Change README do markdown
235 ```ruby
236 devise_for :admins, :controllers => { :sessions => "admins/sessions" }
237 ```
f6cc2192 »
2010-02-17 Devise now allows you to have custom controlleers. Check the README f…
238
bf63824a »
2010-04-12 Improve wording in the README.
239 3) And since we changed the controller, it won't use the "devise/sessions" views, so remember to copy "devise/sessions" to "admin/sessions".
f6cc2192 »
2010-02-17 Devise now allows you to have custom controlleers. Check the README f…
240
f7f086fa »
2012-07-31 Fix README [ci skip]
241 Remember that Devise uses flash messages to let users know if sign in was successful or failed. Devise expects your application to call "flash[:notice]" and "flash[:alert]" as appropriate. Do not print the entire flash hash, print specific keys or at least remove the `:timedout` key from the hash as Devise adds this key in some circumstances, this key is not meant for display.
6d29bcc4 »
2010-02-15 Add mention of flash[:notice] and flash[:alert]
242
bb6d89bb »
2012-01-30 Change README do markdown
243 ### Configuring routes
a36cb6e7 »
2010-07-19 Improve docs for routes customization.
244
245 Devise also ships with default routes. If you need to customize them, you should probably be able to do it through the devise_for method. It accepts several options like :class_name, :path_prefix and so on, including the possibility to change path names for I18n:
246
bb6d89bb »
2012-01-30 Change README do markdown
247 ```ruby
248 devise_for :users, :path => "usuarios", :path_names => { :sign_in => 'login', :sign_out => 'logout', :password => 'secret', :confirmation => 'verification', :unlock => 'unblock', :registration => 'register', :sign_up => 'cmon_let_me_in' }
249 ```
a36cb6e7 »
2010-07-19 Improve docs for routes customization.
250
075fc96f »
2012-03-05 Fix formatting in README
251 Be sure to check `devise_for` documentation for details.
a36cb6e7 »
2010-07-19 Improve docs for routes customization.
252
075fc96f »
2012-03-05 Fix formatting in README
253 If you have the need for more deep customization, for instance to also allow "/sign_in" besides "/users/sign_in", all you need to do is to create your routes normally and wrap them in a `devise_scope` block in the router:
a36cb6e7 »
2010-07-19 Improve docs for routes customization.
254
bb6d89bb »
2012-01-30 Change README do markdown
255 ```ruby
256 devise_scope :user do
257 get "sign_in", :to => "devise/sessions#new"
258 end
259 ```
c0c7aefc »
2010-08-02 Smallish update to README.
260
075fc96f »
2012-03-05 Fix formatting in README
261 This way you tell devise to use the scope :user when "/sign_in" is accessed. Notice `devise_scope` is also aliased as `as` in your router.
a36cb6e7 »
2010-07-19 Improve docs for routes customization.
262
bb6d89bb »
2012-01-30 Change README do markdown
263 ### I18n
0eb8b3b7 »
2009-10-20 Mailer subjects namespaced by model
264
c3d92095 »
2011-04-17 Update README.
265 Devise uses flash messages with I18n with the flash keys :notice and :alert. To customize your app, you can set up your locale file:
0eb8b3b7 »
2009-10-20 Mailer subjects namespaced by model
266
bb6d89bb »
2012-01-30 Change README do markdown
267 ```yaml
268 en:
269 devise:
270 sessions:
271 signed_in: 'Signed in successfully.'
272 ```
0eb8b3b7 »
2009-10-20 Mailer subjects namespaced by model
273
475da069 »
2009-10-29 Make ActionMailer and ActionController more consistent by always usin…
274 You can also create distinct messages based on the resource you've configured using the singular name given in routes:
0eb8b3b7 »
2009-10-20 Mailer subjects namespaced by model
275
bb6d89bb »
2012-01-30 Change README do markdown
276 ```yaml
277 en:
278 devise:
279 sessions:
280 user:
281 signed_in: 'Welcome user, you are signed in.'
282 admin:
283 signed_in: 'Hello admin!'
284 ```
0eb8b3b7 »
2009-10-20 Mailer subjects namespaced by model
285
eb3118e8 »
2010-07-15 Add OAuth2 documentation.
286 The Devise mailer uses a similar pattern to create subject messages:
0eb8b3b7 »
2009-10-20 Mailer subjects namespaced by model
287
bb6d89bb »
2012-01-30 Change README do markdown
288 ```yaml
289 en:
290 devise:
291 mailer:
292 confirmation_instructions:
293 subject: 'Hello everybody!'
294 user_subject: 'Hello User! Please confirm your email'
295 reset_password_instructions:
296 subject: 'Reset instructions'
297 ```
0eb8b3b7 »
2009-10-20 Mailer subjects namespaced by model
298
fdb4cd5b »
2010-09-22 Major update to README - encourage use of the Wiki
299 Take a look at our locale file to check all available messages. You may also be interested in one of the many translations that are available on our wiki:
0eb8b3b7 »
2009-10-20 Mailer subjects namespaced by model
300
13ed2183 »
2011-10-13 many typos (http -> https)
301 https://github.com/plataformatec/devise/wiki/I18n
fdb4cd5b »
2010-09-22 Major update to README - encourage use of the Wiki
302
bb6d89bb »
2012-01-30 Change README do markdown
303 ### Test helpers
97a7f0ed »
2009-11-16 Added test helpers.
304
df0a9401 »
2012-08-05 fixed typo in readme.md
305 Devise includes some tests helpers for functional specs. In order to use them, you need to include Devise in your functional tests by adding the following to the bottom of your `test/test_helper.rb` file:
529cd8b0 »
2009-11-20 Add example for including Devise::TestHelpers in all functional tests…
306
bb6d89bb »
2012-01-30 Change README do markdown
307 ```ruby
308 class ActionController::TestCase
309 include Devise::TestHelpers
310 end
311 ```
529cd8b0 »
2009-11-20 Add example for including Devise::TestHelpers in all functional tests…
312
985b646e »
2012-06-07 Update README.md, closes #1895
313 If you're using RSpec, you can put the following inside a file named `spec/support/devise.rb`:
2d67432c »
2010-07-27 Expanding on testing docs a little to be more useful for those using …
314
bb6d89bb »
2012-01-30 Change README do markdown
315 ```ruby
316 RSpec.configure do |config|
317 config.include Devise::TestHelpers, :type => :controller
318 end
319 ```
2d67432c »
2010-07-27 Expanding on testing docs a little to be more useful for those using …
320
985b646e »
2012-06-07 Update README.md, closes #1895
321 Now you are ready to use the `sign_in` and `sign_out` methods. Such methods have the same signature as in controllers:
322
323 ```ruby
324 sign_in :user, @user # sign_in(scope, resource)
325 sign_in @user # sign_in(resource)
326
327 sign_out :user # sign_out(scope)
328 sign_out @user # sign_out(resource)
329 ```
330
331 There are two things that is important to keep in mind:
332
333 1) These helpers are not going to work for integration tests driven by Capybara or Webrat. They are meant to be used with functional tests only. Instead, fill in the form or explicitly set the user in session;
334
335 2) If you are testing Devise internal controllers or a controller that inherits from Devise's, you need to tell Devise which mapping should be used before a request. This is necessary because Devise gets this information from router, but since functional tests do not pass through the router, it needs to be told explicitly. For example, if you are testing the user scope, simply do:
336
337 @request.env["devise.mapping"] = Devise.mappings[:user]
338 get :new
d9fbdff1 »
2009-12-07 More testing info in README.
339
bb6d89bb »
2012-01-30 Change README do markdown
340 ### Omniauth
1db86a08 »
2010-04-15 More information about ecosystem in the README.
341
1f51524b »
2011-04-11 Edited README.rdoc via GitHub
342 Devise comes with Omniauth support out of the box to authenticate from other providers. You can read more about Omniauth support in the wiki:
9d6a78f7 »
2010-04-22 Add ldap_authenticatable to README.
343
1f51524b »
2011-04-11 Edited README.rdoc via GitHub
344 * https://github.com/plataformatec/devise/wiki/OmniAuth:-Overview
6754ae76 »
2010-08-17 Update README.
345
bb6d89bb »
2012-01-30 Change README do markdown
346 ### Other ORMs
f96061b3 »
2010-09-24 Update docs and CHANGELOG based on the 1.1.3 release from v1.1 branch.
347
348 Devise supports ActiveRecord (default) and Mongoid. To choose other ORM, you just need to require it in the initializer file.
349
bb6d89bb »
2012-01-30 Change README do markdown
350 ### Migrating from other solutions
1db86a08 »
2010-04-15 More information about ecosystem in the README.
351
09088706 »
2010-09-25 Extract encryptors into their own module for better bcrypt support.
352 Devise implements encryption strategies for Clearance, Authlogic and Restful-Authentication. To make use of these strategies, you need set the desired encryptor in the encryptor initializer config option and add :encryptable to your model. You might also need to rename your encrypted password and salt columns to match Devise's fields (encrypted_password and password_salt).
238226e3 »
2010-07-05 Adding a small note about security and issues
353
bb6d89bb »
2012-01-30 Change README do markdown
354 ## Troubleshooting
52282a5a »
2011-10-10 Update README with troubleshooting for heroku
355
bb6d89bb »
2012-01-30 Change README do markdown
356 ### Heroku
52282a5a »
2011-10-10 Update README with troubleshooting for heroku
357
358 Using devise on Heroku with Ruby on Rails 3.1 requires setting:
359
bb6d89bb »
2012-01-30 Change README do markdown
360 ```ruby
361 config.assets.initialize_on_precompile = false
362 ```
52282a5a »
2011-10-10 Update README with troubleshooting for heroku
363
364 Read more about the potential issues at http://guides.rubyonrails.org/asset_pipeline.html
365
bb6d89bb »
2012-01-30 Change README do markdown
366 ## Additional information
238226e3 »
2010-07-05 Adding a small note about security and issues
367
bb6d89bb »
2012-01-30 Change README do markdown
368 ### Warden
6d09eb66 »
2009-11-10 Tidying up encryptors.
369
fdb4cd5b »
2010-09-22 Major update to README - encourage use of the Wiki
370 Devise is based on Warden, which is a general Rack authentication framework created by Daniel Neighman. We encourage you to read more about Warden here:
eb3118e8 »
2010-07-15 Add OAuth2 documentation.
371
13ed2183 »
2011-10-13 many typos (http -> https)
372 https://github.com/hassox/warden
6bd88461 »
2009-12-23 Update Maintainers and Contributors section. Add Grimen for his work …
373
bb6d89bb »
2012-01-30 Change README do markdown
374 ### Contributors
6bd88461 »
2009-12-23 Update Maintainers and Contributors section. Add Grimen for his work …
375
9bdc7113 »
2010-05-03 Update README.
376 We have a long list of valued contributors. Check them all at:
377
13ed2183 »
2011-10-13 many typos (http -> https)
378 https://github.com/plataformatec/devise/contributors
6d09eb66 »
2009-11-10 Tidying up encryptors.
379
bb6d89bb »
2012-01-30 Change README do markdown
380 ### Maintainers
5c59f4cd »
2010-02-27 Fixes to syntax, diction and spelling in README.
381
13ed2183 »
2011-10-13 many typos (http -> https)
382 * José Valim (https://github.com/josevalim)
383 * Carlos Antônio da Silva (https://github.com/carlosantoniodasilva)
b79c6914 »
2011-11-30 Adding myself to the team! w00t!
384 * Rodrigo Flores (https://github.com/rodrigoflores)
5c59f4cd »
2010-02-27 Fixes to syntax, diction and spelling in README.
385
bb6d89bb »
2012-01-30 Change README do markdown
386 ## License
5c59f4cd »
2010-02-27 Fixes to syntax, diction and spelling in README.
387
d4351183 »
2012-04-09 Changes link in copyright notice to Plataformatec's site
388 MIT License. Copyright 2012 Plataformatec. http://plataformatec.com.br
Something went wrong with that request. Please try again.