Skip to content

Instantly share code, notes, and snippets.

Created August 13, 2009 12:56
What would you like to do?
Super simple spam protection for Ruby on Rails
<% form_for @comment do |f| %>
<p style="width: 1px; height: 1px; overflow: hidden;">
Lämna följande fält tomt:
<%= f.text_area :comment %>
<% end %>
class Post < ActiveRecord::Base
attr_accessor :comment # fake attribute used for spam trapping
validates_length_of :comment, :in => 0..1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment