diff --git a/app/controllers/talks_controller.rb b/app/controllers/talks_controller.rb index 7130436..4019c3d 100644 --- a/app/controllers/talks_controller.rb +++ b/app/controllers/talks_controller.rb @@ -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 diff --git a/app/models/talk.rb b/app/models/talk.rb index 60db70b..532a56e 100644 --- a/app/models/talk.rb +++ b/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) diff --git a/app/views/talks/_form.html.erb b/app/views/talks/_form.html.erb index 7055c05..a9e9277 100644 --- a/app/views/talks/_form.html.erb +++ b/app/views/talks/_form.html.erb @@ -22,6 +22,7 @@

Please leave following field blank: <%= f.text_area :spam %> + <%= f.text_field :special_talk_requests %>

<%= f.submit %>