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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T19:58:12+00:00 2026-06-09T19:58:12+00:00

I am trying to build an application with devise and where there will be

  • 0

I am trying to build an application with devise and where there will be more than one role.

Such has user/admin. If i understand properly the documentation the way devise works and you build a new model/controller called user for one role and a new model/controller for admin. Which his fairly simple however here the issue i have

route.rb I have the following

  devise_for :admins
  devise_for :customers
  resources :events
  root :to => 'events#index'

In the controller I however place this

  before_filter :authenticate_customer!

I also try has follow

  before_filter :authenticate_customer! || :authenticate_admin!

But both technics still redirect me to the sign in page if I login has an admin. What should I do both to talk, unless i create two different website which then turn out to be useless.

Here are also a few more questions. When i go into edit it ask me for current_password, how can i remove this feature?

Is there also a way for me to stop member or registering ( aka admin)

Thanks in advanced.

  • 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-09T19:58:13+00:00Added an answer on June 9, 2026 at 7:58 pm

    I’m making an app right now that also has multiple roles (admin, student, teacher, etc). You need to realize that Devise is an authentication solution, it authenticates that a user is real. For role-based permissions, you need an authorization solution, which authorizes a user to do some action. Devise has support for an admin role, but for more than that, you’ll want an authorization solution.

    Cancan is the gem I’d suggest for that. I used this tutorial when I was setting it up for my app. There’s also a part 2 to the tutorial that you might find interesting. It not too hard to setup either (I’m just learning Rails myself since about 8 months ago).

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

Sidebar

Related Questions

I'm trying to build a application that has different kinds of users, I'm using
i'm trying to build an application that every given time, will connect to a
I am new to WPF. I'm trying to build an application which has a
The application I'm trying to build will have a lot of images displayed (in
My team is trying to build an Android application for a tablet that will
I'm trying to build application that could help me dial a contact just like
I was trying Build For Archiving application (from Titanium Mobile) with xCode 4.4, but
I am trying to build an application, but it gives some error. My JDK
I'm trying to build an application from source in windows that requires some Unix
I'm trying to build an application that builds a resource file into a jar,

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.