James
James

Reputation: 5393

How can I get ambethia's captcha plugin to work in rails 3?

I have installed ambethia's captcha plugin as a plugin in my rails 3 app. When I put the <%= recaptcha_tags %> in my view, it prints this on the page:

<script type="text/javascript" src="http://api.recaptcha.net/challenge?k=my_key&error=expression"></script> <noscript> <iframe src="http://api.recaptcha.net/noscript?k=my_other_key" height="300" width="500" frameborder="0"></iframe><br/> <textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea> <input type="hidden" name="recaptcha_response_field" value="manual_challenge"></noscript> 

Is there a way that I can make this work in rails 3? I'd appreciate any help.

Upvotes: 2

Views: 493

Answers (2)

Markus Proske
Markus Proske

Reputation: 3366

You already accepted an answer, however, I used this together with Devise and did not need to use raw - and yes, I am on Rails 3:

app/views/users/registrations/new.html.erb

<h2>Sign up</h2>

<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %>
  <%= devise_error_messages! %>

  <p><%= f.label :email %><br />
  <%= f.text_field :email %></p>

  <p><%= f.label :password %><br />
  <%= f.password_field :password %></p>

  <p><%= f.label :password_confirmation %><br />
  <%= f.password_field :password_confirmation %></p>

  <p><%= recaptcha_tags %></p>

  <p><%= f.submit "Sign up" %></p>
<% end %>

<%= render :partial => "devise/shared/links" %>

Rest of the code is here in an article: http://www.communityguides.eu/articles/10

Upvotes: 0

James
James

Reputation: 5393

<%=raw recaptcha_tags %>

Upvotes: 2

Related Questions