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 6962493
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:40:00+00:00 2026-05-27T15:40:00+00:00

Since authentication gems such as Devise or Clearance uses their own built in controllers,

  • 0

Since authentication gems such as Devise or Clearance uses their own built in controllers, I have a few questions when overriding them. Everytime I’ve tried to override it, something seems to go wrong and I don’t know what it is exactly that caused the error.

For example, to create a new user controller with Devise I understand I have to create a controller like this:

# app/controllers/registrations_controller.rb
class RegistrationsController < Devise::RegistrationsController

All good. Now let’s say I want to add certain things to the def new parts of the controller.

1.) To leave the def create part of the controller alone, I have to put in

def create
    super
end

Is that right? Or do I even need to reference it in the new controller at all?

2.) If I type

def new
    #my custom code here
end

Does that replace the def new part of the original Devise controller, or does it just add to it? Meaning to say, do I also have to put in

resource = build_resource({})
respond_with_navigational(resource){ render_with_scope :new }

which is the default behavior for the def new part of the Devise registrations_controller.rb?

3.) There’s a filter in Devise that prevents you from signing up if you’re logged in, but I need to override this. How do I do this? I’m guessing it has something to do with the prepend_before_filter :require_no_authentication, :only => [ :new, :create, :cancel ] part of registrations_controller.rb, but I’m not too sure.

The same questions apply to Clearance, although with slightly different routes and files.. (I’m asking for Clearance too because I haven’t decided which authentication gem to use yet — Clearance appeals to me because of the lightweight code, but Devise has additional features that I would need too).

  • 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-27T15:40:01+00:00Added an answer on May 27, 2026 at 3:40 pm

    1) That’s correct.

    2) If you want to call the parent’s logic, you can call super at the appropriate point in your sub-class logic.

    3) If you override the RegistrationsController, you can call skip_before_filter :require_no_authentication. This should skip it entirely, so if you need the before filter in certain conditions, you would have to add another before_filter.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Since the offline_access Permission is deprecated in Facebook's Authentication flow, we have problem getting
I am confused about authentication with BlazeDS. Most of the few examples I have
Since CS3 doesn't have a web service component, as previous versions had, is there
Since we moved from IIS 7.0 to IIS 7.5 the Windows Authentication doesn't work
We have several sites that use Forms Based authentication (FBA) within SharePoint. Many of
We have been using Perl's Net:Twitter CPAN module (version 3.12) and basic authentication (not
I have set up authentication against LDAP/AD and it is working fine. But now
I have a custom authentication mechanism in a .NET app that stores the hashes
So I'm looking at the user authentication for django, and since it's turning into
I am using my own custom authentication with IIS, and I want the server

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.