Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5956195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:13:20+00:00 2026-05-22T18:13:20+00:00

What I’ve tried doing already: I’ve tried reading the documentation at github and getting

  • 0

What I’ve tried doing already: I’ve tried reading the documentation at github and getting it to work on Rubymine and I’ve managed to confuse myself with what is needed as far as controllers, and what is needed in the config folder. I’ve tried google and found some pretty good tutorials but their missing steps that I don’t necessarily know to jump too.

What I’m trying to figure out: I want to be able use recaptcha in a login registration utlitizing the devise gem, I’ve already generated the pages for my devise login.

What I have so far:

I’ve installed and attached: devise 1.2.rc and recaptcha 0.3.1 I’m running Rubymine on windows xp. Ruby SDK 1.8.7-p302, with Rails 3.0.3

I’ve been to google and have my public and private keys
The next step tells me I’m supposed to add my keys to project/config/initializers/recaptcha.rb This is what is contained in that file:

 Recaptcha.configure do |config|
  config.public_key = 'myKey'
  config.private_key = 'myKey'
 end

Now I’m supposed to fix up my gemfile with:

 gem 'recaptcha', :require => 'recaptcha/rails'

I also have my config/application.rb reading:

 require 'rails/all'
 require 'net/http'

I’ve also added to my External Libraries/[gem] devise/app/views/devise/registrations/new.html.erb the recaptcha tag:

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

Where I am running into issues (I think) is the
app/controllers/registrations_controller.rb and the config/routes.rb

I’m kinda of at a loss for what exactly goes into these files. Any help would be appreciated or a tutorial someone has written that walks me through this step by step would be very helpful. Thanks

Here’s what I have done after Felix’s post:

external libraries/app/controllers/devise/registrations_controller.rb

class Devise::RegistrationsController < Devise::RegistrationsController
def create

      if verify_recaptcha then
          super
      else
          build_resource
          clean_up_passwords(resource)
          flash[:notice] = 'Invalid Captcha'
          render_with_scope :new
      end

  build_resource

  if resource.save
    if resource.active?
      set_flash_message :notice, :signed_up
      sign_in_and_redirect(resource_name, resource)
    else
      set_flash_message :notice, :inactive_signed_up, :reason => resource.inactive_message.to_s
      expire_session_data_after_sign_in!
      redirect_to after_inactive_sign_up_path_for(resource)
    end
  else
    clean_up_passwords(resource)
    render_with_scope :new
  end
end

From Project/config/routes.rb:

 devise_for :users, :controllers => {:registrations => 'registrations'}  

This is the error that its spitting out:

ActionController::RoutingError (uninitialized constant RegistrationsController):

Rendered C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (0.0ms) ….. any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T18:13:21+00:00Added an answer on May 22, 2026 at 6:13 pm

    For your routes, you can keep your normal devise routes except specifying your custom controller:

    devise_for :users, :controllers => {:registrations => 'registrations'}
    

    In the registrations_controller.rb, you want to subclass the Devise RegistrationsController and override the ‘create’ method:

    class RegistrationsController < Devise::RegistrationsController
        def create
            if verify_recaptcha then
                super
            else
                build_resource
                clean_up_passwords(resource)
                flash[:notice] = 'Invalid Captcha'
                render_with_scope :new
            end
        end
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I want use html5's new tag to play a wav file (currently only supported
I've got a string that has curly quotes in it. I'd like to replace
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.