email_form_generator 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +4 -0
- data/README.txt +7 -7
- data/email_form_generator.rb +2 -2
- data/templates/config.rb +1 -1
- metadata +1 -1
data/History.txt
CHANGED
data/README.txt
CHANGED
@@ -16,7 +16,7 @@ This generator creates a working contact form with validations and delivery, and
|
|
16
16
|
The command generates the following output:
|
17
17
|
|
18
18
|
Your form is ready for use in your application.
|
19
|
-
Before you start the server, fill in the right details into config/
|
19
|
+
Before you start the server, fill in the right details into config/email.yml.
|
20
20
|
exists app/models/
|
21
21
|
exists app/controllers/
|
22
22
|
exists app/helpers/
|
@@ -29,8 +29,8 @@ The command generates the following output:
|
|
29
29
|
create app/views/contact_forms/new.html.erb
|
30
30
|
create app/views/contact_form_mailer/form.html.erb
|
31
31
|
create app/controllers/contact_forms_controller.rb
|
32
|
-
create config/
|
33
|
-
create config/initializers/
|
32
|
+
create config/email.yml
|
33
|
+
create config/initializers/email_config.rb
|
34
34
|
create app/models/contact_form.rb
|
35
35
|
create app/models/contact_form_mailer.rb
|
36
36
|
create app/models/tableless.rb
|
@@ -44,7 +44,7 @@ Also generates a configuration file and an initializer to make configuring email
|
|
44
44
|
|
45
45
|
|
46
46
|
=== Configuration
|
47
|
-
When the generator runs, it creates a configuration file called
|
47
|
+
When the generator runs, it creates a configuration file called email.yml. You need to modify this file so that it reflects your settings for your email server.
|
48
48
|
|
49
49
|
development:
|
50
50
|
email:
|
@@ -67,7 +67,7 @@ When the generator runs, it creates a configuration file called config.yml. You
|
|
67
67
|
delivery_method: test
|
68
68
|
contact_recipient: admin@yourdomain.com
|
69
69
|
|
70
|
-
This file is read by config/initializers/
|
70
|
+
This file is read by config/initializers/email_config.rb, where it configures ActionMailer's settings. It should work fine out of the box for most environments.
|
71
71
|
|
72
72
|
== Tableless Model
|
73
73
|
The Tableless model inherits from ActiveRecord::Base and then removes the
|
@@ -77,7 +77,7 @@ database functionality from the model.
|
|
77
77
|
|
78
78
|
class Foo < Tableless
|
79
79
|
column :bar, :string
|
80
|
-
|
80
|
+
validates_presence_of :bar
|
81
81
|
end
|
82
82
|
|
83
83
|
@foo = Foo.new
|
@@ -91,7 +91,7 @@ This concept was inspired by Rick Olson
|
|
91
91
|
== REQUIREMENTS:
|
92
92
|
|
93
93
|
* The Mocha gem is required because I use it for testing. Change the tests if you want to use something else.
|
94
|
-
* Rails with ActiveRecord
|
94
|
+
* Rails 2.x with ActiveRecord
|
95
95
|
|
96
96
|
== INSTALL:
|
97
97
|
|
data/email_form_generator.rb
CHANGED
@@ -69,8 +69,8 @@ class EmailFormGenerator < Rails::Generator::NamedBase
|
|
69
69
|
'controller.rb', File.join('app/controllers', controller_class_path, "#{controller_file_name}_controller.rb")
|
70
70
|
)
|
71
71
|
|
72
|
-
m.template('config.yml', File.join('config', '
|
73
|
-
m.template('config.rb', File.join('config/initializers', '
|
72
|
+
m.template('config.yml', File.join('config', 'email.yml'), :collision => :skip)
|
73
|
+
m.template('config.rb', File.join('config/initializers', 'email_config.rb'), :collision => :skip)
|
74
74
|
|
75
75
|
m.template(
|
76
76
|
'model.rb', File.join('app/models', "#{file_name}.rb")
|
data/templates/config.rb
CHANGED