Tom Mac wrote:
> Hi
>
> I have to use captcha in my rails application (For example at time
> of register a user) Could anyone please suggest the best and easy to use
> captcha gem or plugin in rails. Rails version is 2.3.5
>
> Thanks
> Tom
Tom, let us say that you are using captcha when users post something. I
assume that you are using SimpleCaptcha
Here is the controller code
---------------------------
def create
@classified = Classified.new(params[:classified])
if @classified.save_with_captcha
redirect_to('/')
else
render :action=>'new'
end
end
Here is the view code
---------------------
<%= show_simple_captcha(:object => "classified", :code_type=>"numeric")
%>
Here is your application controller code
----------------------------------------
include SimpleCaptcha::ControllerHelpers
I have here an working craigslist clone application that uses captcha
http://github.com/railslist/craigslist-clone
--
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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.