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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T12:52:43+00:00 2026-05-31T12:52:43+00:00

I followed below tutorial and built one whole complete app. http://www.tonyamoyal.com/2010/07/28/rails-authentication-with-devise-and-cancan-customizing-devise-controllers/ http://www.tonyamoyal.com/2010/09/29/rails-authentication-with-devise-and-cancan-part-2-restful-resources-for-administrators/comment-page-2/#comment-879 All is

  • 0

I followed below tutorial and built one whole complete app.

http://www.tonyamoyal.com/2010/07/28/rails-authentication-with-devise-and-cancan-customizing-devise-controllers/
http://www.tonyamoyal.com/2010/09/29/rails-authentication-with-devise-and-cancan-part-2-restful-resources-for-administrators/comment-page-2/#comment-879

All is well until I ran into a problem towards the end.

The problem is that when a super_admin user try to create a new user. I got error:

Started POST "/users" for 127.0.0.1 at 2012-03-09 23:37:51 -0500
  Processing by RegistrationsController#create as HTML
  Parameters: {"utf8"=>"?", "authenticity_token"=>"c8v6fmCFSlJV2v9qClxD46c1wcBU7n78Mk9xWsJm/Ls=", "user"=>{"email"=>"test@example.com", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]", "customer_attributes"=>{"first_name"=>"test", "last_name"=>"doe"}, "role_ids"=>["", "3"]}, "commit"=>"Sign up"}
Completed   in 9ms

NameError (uninitialized constant Registration):
What I can figured out is the route conflict. tutorial #1, use devise custom registrations controller for registering new user. tut#2, added another way to create a new user by super_admin. Below is route listing.

cancel_user_registration GET    /users/cancel(.:format)             {:action=>"cancel", :controller=>"registrations"}
       user_registration POST   /users(.:format)                    {:action=>"create", :controller=>"registrations"}
   new_user_registration GET    /users/register(.:format)           {:action=>"new", :controller=>"registrations"}
  edit_user_registration GET    /users/edit(.:format)               {:action=>"edit", :controller=>"registrations"}
                         PUT    /users(.:format)                    {:action=>"update", :controller=>"registrations"}
                         DELETE /users(.:format)                    {:action=>"destroy", :controller=>"registrations"}
       user_confirmation POST   /users/confirmation(.:format)       {:action=>"create", :controller=>"devise/confirmations"}
   new_user_confirmation GET    /users/confirmation/new(.:format)   {:action=>"new", :controller=>"devise/confirmations"}
                         GET    /users/confirmation(.:format)       {:action=>"show", :controller=>"devise/confirmations"}
                   users GET    /users(.:format)                    {:action=>"index", :controller=>"users"}
                         POST   /users(.:format)                    {:action=>"create", :controller=>"users"}
                new_user GET    /users/new(.:format)                {:action=>"new", :controller=>"users"}
               edit_user GET    /users/:id/edit(.:format)           {:action=>"edit", :controller=>"users"}
                    user GET    /users/:id(.:format)                {:action=>"show", :controller=>"users"}
                         PUT    /users/:id(.:format)                {:action=>"update", :controller=>"users"}
                         DELETE /users/:id(.:format)                {:action=>"destroy", :controller=>"users"}

note matching http verb Post /users and user_registrations path was matched first.

                     POST   /users(.:format)                    {:action=>"create", :controller=>"users"}

   user_registration POST   /users(.:format)                    {:action=>"create", :controller=>"registrations"}

But don’t know what is the best way to avoid this conflict. Can you shed some light on this? I could not figure out from your tutorial.

Thanks in advance,

George

  • 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-31T12:52:45+00:00Added an answer on May 31, 2026 at 12:52 pm

    To avoid routes conflict, I decide to move controller/views of index/add/update/delete users by admin into an Admin namespace to preserve the restfulness. i.e.

                     POST   /admin/users(.:format)                    {:action=>"create", :controller=>"admin/users"}
    
       user_registration POST   /users(.:format)                    {:action=>"create", :controller=>"registrations"}
    

    Namespace will cause some coding inconvenience, but that is ok to deal with.

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

Sidebar

Related Questions

I followed this tutorial to setup SVN on my Fedora box http://www.ashishkulkarni.com/installing-subversion-on-fedora-linux/ It worked.
I have followed the instructions at http://www.javacodegeeks.com/2011/01/advanced-smartgwt-tutorial-part-1.html and tried to create a simple screen
I am learning .net and writing a service by following the tutorial below http://www.beansoftware.com/NET-Tutorials/Create-Windows-Services.aspx
I followed the HTML5 Websocket tutorial of the website below: http://net.tutsplus.com/tutorials/javascript-ajax/start-using-html5-websockets-today/ It worked well,
I am trying to setup SSL to my web app and followed tutorial (http://techtracer.com/2007/09/12/setting-up-ssl-on-tomcat-in-3-easy-steps/),
I've followed the below guide to setup my local host http://www.1stwebdesigner.com/tutorials/how-to-setup-local-web-server-with-latest-apache-php-and-mysql-packages/ I'd like to
I followed this post http://neurochannels.blogspot.com/2010/05/how-to-run-r-code-in-matlab.html , to install R(D)Com server in order to call
I have followed this tutorial to get my ListView populating data -- http://android.amberfog.com/?p=296 .
I followed the tutorial http://railscasts.com/episodes/253-carrierwave-file-uploads?view=asciicast and I've got my nested form setup with the
I am trying to implement this example http://www.javacodegeeks.com/2011/02/android-google-maps-tutorial.html and i have followed exactly all

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.