Project

anti_spam

0.0
No commit activity in last 3 years
No release in over 3 years
Prevent spam from non-javascript bots
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

>= 4.0.0
< 5.0, >= 3.0
 Project Readme

anti-spam

This gem implements a simple anti-spam on Rails projects based on David Walsh's solution. Basically, it stops spam comming from bots that doesn't execute JavaScript (most of them), or only execute the page load JavaScript.

First, include this gem on your Gemfile:

gem 'anti_spam'

Add it to your javascript file, usually application.js

//= require anti-spam

Then add the protect_from_spam filter on the desired actions

before_action :protect_from_spam, only: [:create, :update]

That's it! Be aware that users without JavaScript will be considered bots, but nowadays that's very rare, chances are that it's really a bot.