Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to prevent spam in rails?

Does anyone know how to stop spam in rails? I've tried many solutions, which all has failed.

I have tried:

Captcha: I am currently not a fan of captcha since it interrupts when the user is signing up but upon putting captcha on signup page bots still managed to get passed it.

Honeypot: I've created a hidden field set the max character value to 0 and push the form -9999px off the screen and for some reason that does not stop the spam.

askimet: While this works well with wordpress it comes with a monthly fee so I am not interested in something like this.

Is there anyway to stop the spam bots in rails from signing up?

like image 774
Yooku Avatar asked Jul 20 '13 17:07

Yooku


2 Answers

For a honeypot solution, you can use invisible_captcha.

It works pretty nice for small and medium sites, with a simple and configurable approach.

More or less:

In your form:

<%= form_tag(create_topic_path) %>
  <%= invisible_captcha %>
  ...
<% end %>

In your controller:

class TopicsController < ApplicationController
  invisible_captcha only: [:create, :update]
  ...
end
like image 74
markets Avatar answered Oct 16 '22 02:10

markets


Aggressive Spam Bots are using (most of the times) the same tld or selected names, strings or numbers.

You can try Filters Spam to filter out Words etc. you don't like in your App.

And if you have a Really Big Problem with Spam just go with Rakismet (Ruby Akismet), for only 4.99/Month. I dont think this is to much to ask.

like image 24
Mini John Avatar answered Oct 16 '22 02:10

Mini John