Permalink
Browse files

Merge pull request #23 from ryanLonac/patch-1

extra spam protection... I wonder if the spammers read this?
  • Loading branch information...
2 parents f9f1312 + ee877e9 commit 686f0e16cc99e9819467f35854ba030e3c703492 @zenspider zenspider committed Aug 27, 2013
Showing with 5 additions and 0 deletions.
  1. +3 −0 app/controllers/talks_controller.rb
  2. +1 −0 app/models/talk.rb
  3. +1 −0 app/views/talks/_form.html.erb
@@ -8,6 +8,9 @@ def index
end
def create
+ #spam catch to redirect - maybe the bots were ignoring the spam field
+ redirect_to talks_url and return if params['talk']['special_talk_requests'].present?
+
@talk = Talk.new(params[:talk])
if @talk.save
View
@@ -1,5 +1,6 @@
class Talk < ActiveRecord::Base
attr_accessor :spam # fake attribute for spam trapping
+ attr_accessor :special_talk_requests # fake attribute for spam trapping
validates_length_of :spam, :maximum => 0
TALK_KINDS = %w(beginner intermediate advanced lightning)
@@ -22,6 +22,7 @@
<p style="width: 1px; height: 1px; overflow: hidden;">
Please leave following field blank:
<%= f.text_area :spam %>
+ <%= f.text_field :special_talk_requests %>
</p>
<%= f.submit %>
</div>

0 comments on commit 686f0e1

Please sign in to comment.