tkh_mailing_list 0.10.9.1 → 0.10.10

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 34e4898eeaf807945e1983ee1420b25361508206
4
- data.tar.gz: 0bb6eb38ba1abdcb4e196417b957bcf0bdbc0b89
3
+ metadata.gz: eae53eacf735631453be7e76b3f2148757daf0a1
4
+ data.tar.gz: 19730d823e3e74c25aee283834ba2a8359386f63
5
5
  SHA512:
6
- metadata.gz: b652d614a1d5d1dde2ebd24ac4eb03103e395ee0755037099cd4ca218ad78f00e8662cd0605b1634bc0ad22538e320add29b81b0889ba036576bcd535dffd110
7
- data.tar.gz: b93f7b00009553a471c02609c039ad3635012b9081be8a9b212f070ab552a7b83bde21fea272fab3bba89e7c7ee85de8cb28a17a9bb7fa042cd8b83625090a30
6
+ metadata.gz: c35e5c54a41ae36f02109a005871757eae17424b344cb43b01d01c3eac81783e4eaaa90f5763e61d04941e96656c064ff8b358e295bf3f85d948cadf8d099b73
7
+ data.tar.gz: 9fb2c34114ca201de47c77d56a46faf993b0071c14264bd386646af114377f417bce0bb95f4c8afe14bbf5a521da578e711a3f6bf4838a385716915f48def824
data/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
 
4
4
 
5
+ ## 0.10.10
6
+
7
+ * Added an invisible field in the contact form to trick spam robots.
8
+
9
+
5
10
  ## 0.10.9.1
6
11
 
7
12
  * Fixed dependency bug of admin digest email rake task.
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 /users folder.
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
- saved = @contact.save
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')
@@ -9,4 +9,6 @@ class Contact < ActiveRecord::Base
9
9
  scope :chronologically, -> { order('created_at') }
10
10
  scope :by_recent, -> { order('created_at desc') }
11
11
 
12
+ attr_accessor :website
13
+
12
14
  end
@@ -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' %>
@@ -1,3 +1,3 @@
1
1
  module TkhMailingList
2
- VERSION = "0.10.9.1"
2
+ VERSION = "0.10.10"
3
3
  end
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.9.1
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-16 00:00:00.000000000 Z
11
+ date: 2015-02-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler