tkh_mailing_list 0.10.9.1 → 0.10.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +13 -1
- data/app/controllers/contacts_controller.rb +4 -2
- data/app/models/contact.rb +2 -0
- data/app/views/contacts/_form.html.erb +1 -0
- data/lib/tkh_mailing_list/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eae53eacf735631453be7e76b3f2148757daf0a1
|
4
|
+
data.tar.gz: 19730d823e3e74c25aee283834ba2a8359386f63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c35e5c54a41ae36f02109a005871757eae17424b344cb43b01d01c3eac81783e4eaaa90f5763e61d04941e96656c064ff8b358e295bf3f85d948cadf8d099b73
|
7
|
+
data.tar.gz: 9fb2c34114ca201de47c77d56a46faf993b0071c14264bd386646af114377f417bce0bb95f4c8afe14bbf5a521da578e711a3f6bf4838a385716915f48def824
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -21,7 +21,19 @@ Or install it yourself as:
|
|
21
21
|
|
22
22
|
## Usage
|
23
23
|
|
24
|
-
To manage a record go to the /
|
24
|
+
To manage a record go to the /members folder.
|
25
|
+
|
26
|
+
Programmatically, to display a fully working contact form:
|
27
|
+
|
28
|
+
<%= render 'contacts/form' %>
|
29
|
+
|
30
|
+
To embed in any page the contact form, any site administrator can use this string:
|
31
|
+
|
32
|
+
tkh_contact_form
|
33
|
+
|
34
|
+
You MUST hide a spam prevention field in your CSS:
|
35
|
+
|
36
|
+
div.contact_website { display: none; }
|
25
37
|
|
26
38
|
|
27
39
|
## Contributing
|
@@ -15,7 +15,9 @@ class ContactsController < ApplicationController
|
|
15
15
|
|
16
16
|
def create
|
17
17
|
@contact = Contact.new(contact_params)
|
18
|
-
|
18
|
+
# the website form field is invisible to human visitors and works as
|
19
|
+
# a honeypot to spam robots
|
20
|
+
saved = @contact.save unless @contact.website.present?
|
19
21
|
# disabling this and replacing it with a daily digest
|
20
22
|
# this is to mitigate the pain associated with contact spams
|
21
23
|
# sent_email = send_message_to_admin(@contact)
|
@@ -32,7 +34,7 @@ class ContactsController < ApplicationController
|
|
32
34
|
# redirect_to :back
|
33
35
|
# end
|
34
36
|
|
35
|
-
if saved
|
37
|
+
if saved || @contact.website.present?
|
36
38
|
redirect_to root_path, notice: t("contacts.create.notice")
|
37
39
|
else
|
38
40
|
redirect_to :back, alert: t('contacts.create.did_not_reach')
|
data/app/models/contact.rb
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
|
4
4
|
<%= f.input :sender_name, label: t('activerecord.attributes.contacts.sender_name') %>
|
5
5
|
<%= f.input :sender_email, label: t('activerecord.attributes.contacts.sender_email') %>
|
6
|
+
<%= f.input :website, label: 'website' %>
|
6
7
|
<%= f.input :body, label: t('activerecord.attributes.contacts.body'), :input_html => { :rows => 10 } %>
|
7
8
|
|
8
9
|
<%= f.button :submit, t('contacts.send_message'), :class => 'btn btn-primary' %>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tkh_mailing_list
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Swami Atma
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|