contact_us 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +7 -2
- data/app/mailers/contact_us/contact_mailer.rb +1 -1
- data/config/locales/contact_us.de.yml +18 -0
- data/config/locales/contact_us.en.yml +1 -0
- data/config/locales/contact_us.es.yml +1 -0
- data/config/locales/contact_us.it.yml +1 -0
- data/config/locales/contact_us.pt-BR.yml +1 -0
- data/lib/contact_us/version.rb +1 -1
- data/spec/dummy/config/locales/contact_us.de.yml +17 -0
- data/spec/dummy/log/test.log +204 -0
- data/spec/mailers/contact_us/contact_mailer_spec.rb +4 -0
- metadata +8 -5
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Contact Us
|
2
2
|
|
3
|
-
A Rails 3+ Engine providing a basic contact form.
|
3
|
+
A Rails 3+ Engine providing a basic contact form.
|
4
4
|
|
5
5
|
[![Build Status](https://secure.travis-ci.org/jdutil/contact_us.png)](http://travis-ci.org/jdutil/contact_us)
|
6
6
|
|
@@ -13,11 +13,16 @@ There is also a demo application showing how the ContactUs form works:
|
|
13
13
|
|
14
14
|
Contact Us requires the Formtastic Gem. Read more about Formtastic @ https://github.com/justinfrench/formtastic
|
15
15
|
|
16
|
+
I used Formtastic as a dependency to keep things simple, and hook into your apps custom Formtastic stylesheets.
|
17
|
+
People have different tastes for their html / css markup, and I find Formtastic to be a great standardized and reusable way to build forms across apps.
|
18
|
+
|
19
|
+
If you don't want to have Formtastic as a dependency there is a fork of this project without it [here](https://github.com/sch1zo/contact_us).
|
20
|
+
|
16
21
|
## INSTALLATION
|
17
22
|
|
18
23
|
In your `Gemfile`, add the following dependencies:
|
19
24
|
|
20
|
-
gem 'contact_us', '~> 0.1.
|
25
|
+
gem 'contact_us', '~> 0.1.4'
|
21
26
|
|
22
27
|
From `Rails.root` run:
|
23
28
|
|
@@ -3,7 +3,7 @@ class ContactUs::ContactMailer < ActionMailer::Base
|
|
3
3
|
@message = contact.message
|
4
4
|
|
5
5
|
mail :from => contact.email,
|
6
|
-
:subject =>
|
6
|
+
:subject => t('contact_us.contact_mailer.contact_email.subject', :email => contact.email),
|
7
7
|
:to => ContactUs.mailer_to
|
8
8
|
end
|
9
9
|
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# Sample localization file for German. Add more files in this directory for other locales.
|
2
|
+
# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
|
3
|
+
|
4
|
+
de:
|
5
|
+
contact_us:
|
6
|
+
contact_mailer:
|
7
|
+
contact_email:
|
8
|
+
sent_by_contact_form: "Gesendet durch das Kontaktformular."
|
9
|
+
subject: "Contact Us message from %{email}"
|
10
|
+
contacts:
|
11
|
+
new:
|
12
|
+
contact_us: "Kontaktiere Uns"
|
13
|
+
email: "Email"
|
14
|
+
message: "Nachricht"
|
15
|
+
submit: "Abschicken"
|
16
|
+
notices:
|
17
|
+
error: "Beide Felder müssen ausgefüllt werden."
|
18
|
+
success: "Die Nachricht wurde erfolgreich versendet."
|
data/lib/contact_us/version.rb
CHANGED
@@ -0,0 +1,17 @@
|
|
1
|
+
# Sample localization file for German. Add more files in this directory for other locales.
|
2
|
+
# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
|
3
|
+
|
4
|
+
de:
|
5
|
+
contact_us:
|
6
|
+
contact_mailer:
|
7
|
+
contact_email:
|
8
|
+
sent_by_contact_form: "Gesendet durch das Kontaktformular."
|
9
|
+
contacts:
|
10
|
+
new:
|
11
|
+
contact_us: "Kontaktiere Uns"
|
12
|
+
email: "Email"
|
13
|
+
message: "Nachricht"
|
14
|
+
submit: "Abschicken"
|
15
|
+
notices:
|
16
|
+
error: "Beide Felder müssen ausgefüllt werden."
|
17
|
+
success: "Die Nachricht wurde erfolgreich versendet."
|
data/spec/dummy/log/test.log
CHANGED
@@ -1591,6 +1591,210 @@ Content-Type: text/html;
|
|
1591
1591
|
charset=UTF-8
|
1592
1592
|
Content-Transfer-Encoding: 7bit
|
1593
1593
|
|
1594
|
+
<p>Thanks!</p>
|
1595
|
+
<p>---------------------</p>
|
1596
|
+
<p>Sent by contact form.</p>
|
1597
|
+
[1m[36mSQL (0.5ms)[0m [1m SELECT name
|
1598
|
+
FROM sqlite_master
|
1599
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
1600
|
+
[0m
|
1601
|
+
[1m[35mSQL (0.3ms)[0m select sqlite_version(*)
|
1602
|
+
[1m[36mSQL (0.3ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) [0m
|
1603
|
+
[1m[35mSQL (0.1ms)[0m PRAGMA index_list("schema_migrations")
|
1604
|
+
[1m[36mSQL (0.1ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
1605
|
+
[1m[35mSQL (0.1ms)[0m SELECT name
|
1606
|
+
FROM sqlite_master
|
1607
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
1608
|
+
Processing by ContactUs::ContactsController#create as HTML
|
1609
|
+
Parameters: {"contact_us_contact"=>{"email"=>"test@test.com", "message"=>"test"}}
|
1610
|
+
Rendered /Users/JD/contact_us/app/views/contact_us/contact_mailer/contact_email.html.erb (1.1ms)
|
1611
|
+
|
1612
|
+
Sent mail to contact@please-change-me.com (306ms)
|
1613
|
+
Date: Mon, 26 Sep 2011 12:44:03 -0400
|
1614
|
+
From: test@test.com
|
1615
|
+
To: contact@please-change-me.com
|
1616
|
+
Message-ID: <4e80abd3a097f_16a363fd34c434ec8740db@JDs-MacBook-Pro.local.mail>
|
1617
|
+
Subject: Contact Us message from test@test.com
|
1618
|
+
Mime-Version: 1.0
|
1619
|
+
Content-Type: text/html;
|
1620
|
+
charset=UTF-8
|
1621
|
+
Content-Transfer-Encoding: 7bit
|
1622
|
+
|
1623
|
+
<p>test</p>
|
1624
|
+
<p>---------------------</p>
|
1625
|
+
<p>Sent by contact form.</p>
|
1626
|
+
Redirected to http://test.host/
|
1627
|
+
Completed 302 Found in 1311ms
|
1628
|
+
Processing by ContactUs::ContactsController#create as HTML
|
1629
|
+
Parameters: {"contact_us_contact"=>{"email"=>"test@test.com", "message"=>""}}
|
1630
|
+
Completed 200 OK in 94ms (Views: 91.8ms | ActiveRecord: 1.4ms)
|
1631
|
+
Processing by ContactUs::ContactsController#new as HTML
|
1632
|
+
Completed 200 OK in 3ms (Views: 2.7ms | ActiveRecord: 0.0ms)
|
1633
|
+
|
1634
|
+
|
1635
|
+
Started GET "/contact_us" for 127.0.0.1 at 2011-09-26 12:44:04 -0400
|
1636
|
+
Processing by ContactUs::ContactsController#new as HTML
|
1637
|
+
Completed 200 OK in 18ms (Views: 17.4ms | ActiveRecord: 0.0ms)
|
1638
|
+
|
1639
|
+
|
1640
|
+
Started GET "/contact_us" for 127.0.0.1 at 2011-09-26 12:44:04 -0400
|
1641
|
+
Processing by ContactUs::ContactsController#new as HTML
|
1642
|
+
Completed 200 OK in 9ms (Views: 8.5ms | ActiveRecord: 0.0ms)
|
1643
|
+
|
1644
|
+
|
1645
|
+
Started GET "/contact_us" for 127.0.0.1 at 2011-09-26 12:44:04 -0400
|
1646
|
+
Processing by ContactUs::ContactsController#new as HTML
|
1647
|
+
Completed 200 OK in 8ms (Views: 7.8ms | ActiveRecord: 0.0ms)
|
1648
|
+
|
1649
|
+
|
1650
|
+
Started GET "/contact_us" for 127.0.0.1 at 2011-09-26 12:44:04 -0400
|
1651
|
+
Processing by ContactUs::ContactsController#new as HTML
|
1652
|
+
Completed 200 OK in 9ms (Views: 8.5ms | ActiveRecord: 0.0ms)
|
1653
|
+
|
1654
|
+
|
1655
|
+
Started GET "/contact_us" for 127.0.0.1 at 2011-09-26 12:44:04 -0400
|
1656
|
+
Processing by ContactUs::ContactsController#new as HTML
|
1657
|
+
Completed 200 OK in 10ms (Views: 9.4ms | ActiveRecord: 0.0ms)
|
1658
|
+
|
1659
|
+
|
1660
|
+
Started POST "/contacts" for 127.0.0.1 at 2011-09-26 12:44:04 -0400
|
1661
|
+
Processing by ContactUs::ContactsController#create as HTML
|
1662
|
+
Parameters: {"utf8"=>"✓", "contact_us_contact"=>{"email"=>"test@example.com", "message"=>"howdy"}, "commit"=>"Submit"}
|
1663
|
+
|
1664
|
+
Sent mail to contact@please-change-me.com (15ms)
|
1665
|
+
Date: Mon, 26 Sep 2011 12:44:04 -0400
|
1666
|
+
From: test@example.com
|
1667
|
+
To: contact@please-change-me.com
|
1668
|
+
Message-ID: <4e80abd4c8f30_16a363fd34c434ec874131@JDs-MacBook-Pro.local.mail>
|
1669
|
+
Subject: Contact Us message from test@example.com
|
1670
|
+
Mime-Version: 1.0
|
1671
|
+
Content-Type: text/html;
|
1672
|
+
charset=UTF-8
|
1673
|
+
Content-Transfer-Encoding: 7bit
|
1674
|
+
|
1675
|
+
<p>howdy</p>
|
1676
|
+
<p>---------------------</p>
|
1677
|
+
<p>Sent by contact form.</p>
|
1678
|
+
Redirected to http://www.example.com/
|
1679
|
+
Completed 302 Found in 33ms
|
1680
|
+
|
1681
|
+
|
1682
|
+
Started GET "/" for 127.0.0.1 at 2011-09-26 12:44:04 -0400
|
1683
|
+
Processing by ContactUs::ContactsController#new as HTML
|
1684
|
+
Completed 200 OK in 9ms (Views: 8.4ms | ActiveRecord: 0.0ms)
|
1685
|
+
|
1686
|
+
|
1687
|
+
Started GET "/contact_us" for 127.0.0.1 at 2011-09-26 12:44:04 -0400
|
1688
|
+
Processing by ContactUs::ContactsController#new as HTML
|
1689
|
+
Completed 200 OK in 11ms (Views: 10.7ms | ActiveRecord: 0.0ms)
|
1690
|
+
|
1691
|
+
|
1692
|
+
Started POST "/contacts" for 127.0.0.1 at 2011-09-26 12:44:04 -0400
|
1693
|
+
Processing by ContactUs::ContactsController#create as HTML
|
1694
|
+
Parameters: {"utf8"=>"✓", "contact_us_contact"=>{"email"=>"test@example.com", "message"=>"howdy"}, "commit"=>"Submit"}
|
1695
|
+
|
1696
|
+
Sent mail to contact@please-change-me.com (18ms)
|
1697
|
+
Date: Mon, 26 Sep 2011 12:44:04 -0400
|
1698
|
+
From: test@example.com
|
1699
|
+
To: contact@please-change-me.com
|
1700
|
+
Message-ID: <4e80abd4ee425_16a363fd34c434ec87429@JDs-MacBook-Pro.local.mail>
|
1701
|
+
Subject: Contact Us message from test@example.com
|
1702
|
+
Mime-Version: 1.0
|
1703
|
+
Content-Type: text/html;
|
1704
|
+
charset=UTF-8
|
1705
|
+
Content-Transfer-Encoding: 7bit
|
1706
|
+
|
1707
|
+
<p>howdy</p>
|
1708
|
+
<p>---------------------</p>
|
1709
|
+
<p>Sent by contact form.</p>
|
1710
|
+
Redirected to http://www.example.com/
|
1711
|
+
Completed 302 Found in 40ms
|
1712
|
+
|
1713
|
+
|
1714
|
+
Started GET "/" for 127.0.0.1 at 2011-09-26 12:44:04 -0400
|
1715
|
+
Processing by ContactUs::ContactsController#new as HTML
|
1716
|
+
Completed 200 OK in 10ms (Views: 9.9ms | ActiveRecord: 0.0ms)
|
1717
|
+
|
1718
|
+
|
1719
|
+
Started GET "/contact_us" for 127.0.0.1 at 2011-09-26 12:44:05 -0400
|
1720
|
+
Processing by ContactUs::ContactsController#new as HTML
|
1721
|
+
Completed 200 OK in 8ms (Views: 7.7ms | ActiveRecord: 0.0ms)
|
1722
|
+
|
1723
|
+
|
1724
|
+
Started POST "/contacts" for 127.0.0.1 at 2011-09-26 12:44:05 -0400
|
1725
|
+
Processing by ContactUs::ContactsController#create as HTML
|
1726
|
+
Parameters: {"utf8"=>"✓", "contact_us_contact"=>{"email"=>"test@example.com", "message"=>"howdy"}, "commit"=>"Submit"}
|
1727
|
+
|
1728
|
+
Sent mail to contact@please-change-me.com (14ms)
|
1729
|
+
Date: Mon, 26 Sep 2011 12:44:05 -0400
|
1730
|
+
From: test@example.com
|
1731
|
+
To: contact@please-change-me.com
|
1732
|
+
Message-ID: <4e80abd5d9fe_16a363fd34c434ec874357@JDs-MacBook-Pro.local.mail>
|
1733
|
+
Subject: Contact Us message from test@example.com
|
1734
|
+
Mime-Version: 1.0
|
1735
|
+
Content-Type: text/html;
|
1736
|
+
charset=UTF-8
|
1737
|
+
Content-Transfer-Encoding: 7bit
|
1738
|
+
|
1739
|
+
<p>howdy</p>
|
1740
|
+
<p>---------------------</p>
|
1741
|
+
<p>Sent by contact form.</p>
|
1742
|
+
Redirected to http://www.example.com/
|
1743
|
+
Completed 302 Found in 32ms
|
1744
|
+
|
1745
|
+
|
1746
|
+
Started GET "/" for 127.0.0.1 at 2011-09-26 12:44:05 -0400
|
1747
|
+
Processing by ContactUs::ContactsController#new as HTML
|
1748
|
+
Completed 200 OK in 9ms (Views: 8.8ms | ActiveRecord: 0.0ms)
|
1749
|
+
|
1750
|
+
|
1751
|
+
Started GET "/contact_us" for 127.0.0.1 at 2011-09-26 12:44:05 -0400
|
1752
|
+
Processing by ContactUs::ContactsController#new as HTML
|
1753
|
+
Completed 200 OK in 9ms (Views: 8.8ms | ActiveRecord: 0.0ms)
|
1754
|
+
|
1755
|
+
|
1756
|
+
Started POST "/contacts" for 127.0.0.1 at 2011-09-26 12:44:05 -0400
|
1757
|
+
Processing by ContactUs::ContactsController#create as HTML
|
1758
|
+
Parameters: {"utf8"=>"✓", "contact_us_contact"=>{"email"=>"a", "message"=>""}, "commit"=>"Submit"}
|
1759
|
+
Completed 200 OK in 11ms (Views: 8.6ms | ActiveRecord: 0.0ms)
|
1760
|
+
|
1761
|
+
|
1762
|
+
Started GET "/contact_us" for 127.0.0.1 at 2011-09-26 12:44:05 -0400
|
1763
|
+
Processing by ContactUs::ContactsController#new as HTML
|
1764
|
+
Completed 200 OK in 8ms (Views: 7.4ms | ActiveRecord: 0.0ms)
|
1765
|
+
|
1766
|
+
|
1767
|
+
Started POST "/contacts" for 127.0.0.1 at 2011-09-26 12:44:05 -0400
|
1768
|
+
Processing by ContactUs::ContactsController#create as HTML
|
1769
|
+
Parameters: {"utf8"=>"✓", "contact_us_contact"=>{"email"=>"a", "message"=>""}, "commit"=>"Submit"}
|
1770
|
+
Completed 200 OK in 73ms (Views: 70.7ms | ActiveRecord: 0.0ms)
|
1771
|
+
|
1772
|
+
Sent mail to contact@please-change-me.com (16ms)
|
1773
|
+
Date: Mon, 26 Sep 2011 12:44:05 -0400
|
1774
|
+
From: test@email.com
|
1775
|
+
To: contact@please-change-me.com
|
1776
|
+
Message-ID: <4e80abd575771_16a363fd34c434ec87444f@JDs-MacBook-Pro.local.mail>
|
1777
|
+
Subject: Contact Us message from test@email.com
|
1778
|
+
Mime-Version: 1.0
|
1779
|
+
Content-Type: text/html;
|
1780
|
+
charset=UTF-8
|
1781
|
+
Content-Transfer-Encoding: 7bit
|
1782
|
+
|
1783
|
+
<p>Thanks!</p>
|
1784
|
+
<p>---------------------</p>
|
1785
|
+
<p>Sent by contact form.</p>
|
1786
|
+
|
1787
|
+
Sent mail to contact@please-change-me.com (23ms)
|
1788
|
+
Date: Mon, 26 Sep 2011 12:44:05 -0400
|
1789
|
+
From: test@email.com
|
1790
|
+
To: contact@please-change-me.com
|
1791
|
+
Message-ID: <4e80abd586a89_16a363fd34c434ec874578@JDs-MacBook-Pro.local.mail>
|
1792
|
+
Subject: Contact Us message from test@email.com
|
1793
|
+
Mime-Version: 1.0
|
1794
|
+
Content-Type: text/html;
|
1795
|
+
charset=UTF-8
|
1796
|
+
Content-Transfer-Encoding: 7bit
|
1797
|
+
|
1594
1798
|
<p>Thanks!</p>
|
1595
1799
|
<p>---------------------</p>
|
1596
1800
|
<p>Sent by contact form.</p>
|
@@ -27,6 +27,10 @@ describe ContactUs::ContactMailer do
|
|
27
27
|
@mailer.from.should eql([@contact.email])
|
28
28
|
end
|
29
29
|
|
30
|
+
it "should have users email in the subject line" do
|
31
|
+
@mailer.subject.should eql("Contact Us message from #{@contact.email}")
|
32
|
+
end
|
33
|
+
|
30
34
|
it "should have the message in the body" do
|
31
35
|
@mailer.body.should match("<p>Thanks!</p>")
|
32
36
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: contact_us
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.1.
|
5
|
+
version: 0.1.4
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Jeff Dutil
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-09-
|
13
|
+
date: 2011-09-26 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: capybara
|
@@ -99,6 +99,7 @@ files:
|
|
99
99
|
- app/views/contact_us/contact_mailer/contact_email.html.erb
|
100
100
|
- app/views/contact_us/contact_mailer/contact_email.text.plain.erb
|
101
101
|
- app/views/contact_us/contacts/new.html.erb
|
102
|
+
- config/locales/contact_us.de.yml
|
102
103
|
- config/locales/contact_us.en.yml
|
103
104
|
- config/locales/contact_us.es.yml
|
104
105
|
- config/locales/contact_us.it.yml
|
@@ -127,6 +128,7 @@ files:
|
|
127
128
|
- spec/dummy/config/initializers/mime_types.rb
|
128
129
|
- spec/dummy/config/initializers/secret_token.rb
|
129
130
|
- spec/dummy/config/initializers/session_store.rb
|
131
|
+
- spec/dummy/config/locales/contact_us.de.yml
|
130
132
|
- spec/dummy/config/locales/contact_us.es.yml
|
131
133
|
- spec/dummy/config/locales/contact_us.it.yml
|
132
134
|
- spec/dummy/config/locales/contact_us.pt-BR.yml
|
@@ -166,7 +168,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
166
168
|
requirements:
|
167
169
|
- - ">="
|
168
170
|
- !ruby/object:Gem::Version
|
169
|
-
hash:
|
171
|
+
hash: 3235567858763221066
|
170
172
|
segments:
|
171
173
|
- 0
|
172
174
|
version: "0"
|
@@ -175,14 +177,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
175
177
|
requirements:
|
176
178
|
- - ">="
|
177
179
|
- !ruby/object:Gem::Version
|
178
|
-
hash:
|
180
|
+
hash: 3235567858763221066
|
179
181
|
segments:
|
180
182
|
- 0
|
181
183
|
version: "0"
|
182
184
|
requirements: []
|
183
185
|
|
184
186
|
rubyforge_project: contact_us
|
185
|
-
rubygems_version: 1.8.
|
187
|
+
rubygems_version: 1.8.10
|
186
188
|
signing_key:
|
187
189
|
specification_version: 3
|
188
190
|
summary: Gem providing simple Contact Us functionality with a Rails 3+ Engine.
|
@@ -204,6 +206,7 @@ test_files:
|
|
204
206
|
- spec/dummy/config/initializers/mime_types.rb
|
205
207
|
- spec/dummy/config/initializers/secret_token.rb
|
206
208
|
- spec/dummy/config/initializers/session_store.rb
|
209
|
+
- spec/dummy/config/locales/contact_us.de.yml
|
207
210
|
- spec/dummy/config/locales/contact_us.es.yml
|
208
211
|
- spec/dummy/config/locales/contact_us.it.yml
|
209
212
|
- spec/dummy/config/locales/contact_us.pt-BR.yml
|