Skip to content

Commit

Permalink
Merge pull request #23 from ryanLonac/patch-1
Browse files Browse the repository at this point in the history
extra spam protection... I wonder if the spammers read this?
  • Loading branch information
zenspider committed Aug 27, 2013
2 parents f9f1312 + ee877e9 commit 686f0e1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/controllers/talks_controller.rb
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions app/models/talk.rb
@@ -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)
Expand Down
1 change: 1 addition & 0 deletions app/views/talks/_form.html.erb
Expand Up @@ -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>
Expand Down

0 comments on commit 686f0e1

Please sign in to comment.