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

  • Home
  • SEARCH
  • 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 8221109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T13:47:14+00:00 2026-06-07T13:47:14+00:00

I am using cancan, devise, and omniauth in a rails app. I’m quite happy

  • 0

I am using cancan, devise, and omniauth in a rails app. I’m quite happy with omniauth, and the method current_user is helpful. Ability class is also helpful. When a user registers, I only get his email from omniauth, and manually create a User for him with some parameters. So I am not using the devise way of creating users.

Consequently, I have no need for :database_authenticatable. Having it prevents me from saving a user without a password. Not having it however, makes users go to ‘/’ instead of ‘/users/sign_in’ when they hit an unauthorized resource.

I would like to not use :database_authenticatable, and have users go to ‘/users/sign_in’ if they are unauthorized. How would I do that?

Note: almost all my controllers have fine-grained authenticate_user! beforefilter, for example:

class UsersController < ApplicationController

    before_filter :authenticate_user!, :except => [:index, :index_small, :show,
     :new , :sign_in ]

so I’m not sure if I can do anything with before_filter :authenticate_user! in application_controller. If I can get rid of this filter on all the controllers, it would be nice also.

  • 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-06-07T13:47:16+00:00Added an answer on June 7, 2026 at 1:47 pm

    Got it!

    In any helper, overwrite sign_in_path

     module UsersHelper
      def sign_in_path
        '/users/sign_in'
      end
     end
    

    also, most importantly, before_filter :authenticate_user! should be removed completely from controllers, if cancan is used.

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

Sidebar

Related Questions

I'm developing a Rails 3 app using Devise and CanCan. The app allows anonymous
I'm using CanCan for authorization. I define the model-action-user rules in /app/config/ability.rb and it's
I'm trying to get some basic authentication/authorization with devise/cancan with Rails. Rather than using
Using Rails 3.1.3 with Devise 1.5.3. My app has accounts and users. Each account
I'm quite new to this and I'm using cancan + devise for my user
I'm using Cancan, Devise, Rails 3 for my ordering application. Each user has many
I'm using Devise and CanCan to create a backbone.js front-end and Rails 3.0.7 for
I'm using devise and cancan in a Rails 3.2 project. I have an event
I have an app I'm writing in rails 3 w/ cancan and devise. I'm
I'm using CanCan and Devise for the auth processes in an app and everything

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.