title: Setting up recaptcha with devise rails 3.1
body: <p>I followed the devise wiki <a href="https://github.com/plataformatec/devise/wiki/How-To%3a-Use-Recaptcha-with-Devise" rel="nofollow">here</a> and I get a template error when I try to create a new user. This is what I have done. </p>
  
  <p>Set up my public and private keys in config/environment.rb</p>
  
  <pre><code>ENV['RECAPTCHA_PUBLIC_KEY']='examplepubkey'
  ENV['RECAPTCHA_PRIVATE_KEY'] = 'exampleprivkey'
  </code></pre>
  
  <p>I then added the gem to my gemfile and ran bundle install</p>
  
  <pre><code>gem 'recaptcha', :require =&gt; 'recaptcha/rails'
  </code></pre>
  
  <p>I then added a registrations controller by running rails g controller Registrations create and adding this to the file.</p>
  
  <pre><code>class RegistrationsController &lt; Devise::RegistrationsController
  
    def create
      if verify_recaptcha
        super
      else
        build_resource
        clean_up_passwords(resource)
        flash[:alert] = "There was an error with the recaptcha code below. Please re-enter the code and click submit."
        render_with_scope :new
      end
    end  
  
  end
  </code></pre>
  
  <p>I also added the recaptcha tags to views/devise/registrations/new</p>
  
  <pre><code>&lt;div&gt;&lt;%= recaptcha_tags %&gt;&lt;/div&gt;
  </code></pre>
  
  <p>Then I edited the routes file to look like:</p>
  
  <pre><code>devise_for :users, :controllers =&gt; { :registrations =&gt; "registrations" }, :path =&gt; "users"
  </code></pre>
  
  <p>When I check out the link in my browser I get </p>
  
  <pre><code>Template is missing
  
  Missing template registrations/new with {:handlers=&gt;[:erb, :builder, :coffee], 
  :formats=&gt;[:html], :locale=&gt;[:en, :en]}. Searched in: * 
  "/Users/thomascioppettini/rails_projects/want_freight/app/views" *
  "/Users/thomascioppettini/.rvm/gems/ruby-1.9.2-p180@standard/gems/devise-1.4.5/app/views"
  </code></pre>
  
  <p>[edit]</p>
  
  <p>I was able to get the captcha to appear by deleting the bit I added about controllers, but the captcha passes when I add any text into the text field or leave it blank. </p>
  
  <p>[edit2]
  I was able to figure out how to solve the problem and will post the solution when stack overflow will allow me to. </p>