userify 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +6 -3
- data/Rakefile +1 -1
- data/app/models/userify_mailer.rb +4 -4
- data/generators/userify/templates/README +4 -5
- metadata +1 -1
data/README.markdown
CHANGED
@@ -26,7 +26,6 @@ Here's the setup method.
|
|
26
26
|
|
27
27
|
Install Userify gem, as well as Haml.
|
28
28
|
|
29
|
-
sudo gem sources -a http://gems.github.com # if you haven't do it already
|
30
29
|
sudo gem install haml
|
31
30
|
sudo gem install userify
|
32
31
|
|
@@ -34,7 +33,7 @@ In config/environment.rb:
|
|
34
33
|
|
35
34
|
config.gem "haml"
|
36
35
|
config.gem "userify"
|
37
|
-
|
36
|
+
UserifyMailer.sender_address = %("Do Not Reply" <donotreply@example.com>)
|
38
37
|
|
39
38
|
Run the generator:
|
40
39
|
|
@@ -42,7 +41,11 @@ Run the generator:
|
|
42
41
|
|
43
42
|
In config/environments/development.rb and test.rb:
|
44
43
|
|
45
|
-
|
44
|
+
config.action_mailer.default_url_options = { :host => "localhost", :port => 3000 }
|
45
|
+
|
46
|
+
In config/environments/production.rb:
|
47
|
+
|
48
|
+
config.action_mailer.default_url_options = { :host => "example.com" }
|
46
49
|
|
47
50
|
Define root_url to *something* in your config/routes.rb. Assuming home controller for root:
|
48
51
|
|
data/Rakefile
CHANGED
@@ -35,7 +35,7 @@ task :default => ['test:all', 'test:features']
|
|
35
35
|
|
36
36
|
gem_spec = Gem::Specification.new do |gem_spec|
|
37
37
|
gem_spec.name = "userify"
|
38
|
-
gem_spec.version = "0.2.
|
38
|
+
gem_spec.version = "0.2.1"
|
39
39
|
gem_spec.summary = "Super simple authentication system for Rails, using username, email and password."
|
40
40
|
gem_spec.email = "kenn.ejima <at> gmail.com"
|
41
41
|
gem_spec.homepage = "http://github.com/kenn/userify"
|
@@ -1,16 +1,16 @@
|
|
1
1
|
class UserifyMailer < ActionMailer::Base
|
2
|
-
|
3
|
-
|
2
|
+
@@sender_address = %("Do Not Reply" <donotreply@example.com>)
|
3
|
+
cattr_accessor :sender_address
|
4
4
|
|
5
5
|
def reset_password(user)
|
6
|
-
from
|
6
|
+
from sender_address
|
7
7
|
recipients user.email
|
8
8
|
subject "Reset your password"
|
9
9
|
body :user => user
|
10
10
|
end
|
11
11
|
|
12
12
|
def confirmation(user)
|
13
|
-
from
|
13
|
+
from sender_address
|
14
14
|
recipients user.email
|
15
15
|
subject "Account confirmation"
|
16
16
|
body :user => user
|
@@ -3,17 +3,16 @@
|
|
3
3
|
|
4
4
|
Ok, enough fancy automatic stuff. Time for some old school monkey copy-pasting.
|
5
5
|
|
6
|
-
1. Define
|
7
|
-
In config/environments/test.rb and config/environments/development.rb it can be:
|
6
|
+
1. Define default_url_options in your config/environments/* files.
|
8
7
|
|
9
|
-
|
8
|
+
config.action_mailer.default_url_options = { :host => "localhost", :port => 3000 }
|
9
|
+
config.action_mailer.default_url_options = { :host => "example.com" }
|
10
10
|
|
11
11
|
In production.rb it must be the actual host your application is deployed to.
|
12
|
-
The constant is used by mailers to generate URLs in emails.
|
13
12
|
|
14
13
|
2. In config/environment.rb:
|
15
14
|
|
16
|
-
|
15
|
+
UserifyMailer.sender_address = %("Do Not Reply" <donotreply@example.com>)
|
17
16
|
|
18
17
|
3. Define root_url to *something* in your config/routes.rb:
|
19
18
|
|