hi, I''m doing a registration form with rails, is there any simple method to do a spam preventer with a generator of random number/characters? thanks :) -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
The following will give you a random 8-number/character string assuming you have an object called @user (or whatever gets created upon registration/create): MD5.hexdigest((@user.object_id + rand(255)).to_s).to_s[0..7] You can also use captchas (Completely Automated Public Turing Test to Tell Computers and Humans Apart) which are those images you see with random numbers: http://captcha.rubyforge.org/ Steven -- Steven Smith, CEO, FiveRuns http://www.fiveruns.com On Jan 6, 2007, at 8:22 PM, John wrote:> > hi, I''m doing a registration form with rails, is there any simple > method > to do a spam preventer with a generator of random number/characters? > thanks :) > > -- > Posted via http://www.ruby-forum.com/. > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I noted there was an article about it: http://www.rubyonrailsblog.com/articles/2006/09/29/use-the-ruby-captcha-gem-for-rails-user-registration -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---