Custom Registrations Controller for Devise not Overriding Create Action?

On the third line of your routes. Rb file, I think you mean :controllers => … not :controller => … . You're missing an 's'.

Up vote 0 down vote favorite share g+ share fb share tw.

I have been fighting with this for days now. I have created my own Registrations Controller to allow for an amdin to create and delete users. I have left the :registerable module in my devise configuration, as I also want to users to be able to edit their profiles.

I have tried taking that module out just to see if it would solve my issue. The problem that I have, is that when I create a new user as an admin, it still signs that user in, despite having my own create action. I have tried everything that I can think of to get beyond this and I am stuck.

My Registrations Controller: class RegistrationsController note, after_sign_up_path_for was overriden here as a test to see if that would work class ApplicationController { :registrations => "registrations"} devise_scope :user do get '/login' => 'devise/sessions#new' get '/logout' => 'devise/sessions#destroy' end resources :users, :controller => "users" resources :projects root :to => 'home#index' end And my Users Controller for admin view class UsersController current_user. Id ) respond_to do |format| format. Html # index.html.

Erb format. Xml { render :xml => @users } end end # DELETE /users/1 # DELETE /users/1. Xml def destroy @user = User.

Find(params:id) @user. Destroy respond_to do |format| format. Html { redirect_to(users_url) } format.

Xml { head :ok } end end end Rake Routes Output: new_user_session GET /users/sign_in(.:format) {:action=>"new", :controller=>"devise/sessions"} user_session POST /users/sign_in(.:format) {:action=>"create", :controller=>"devise/sessions"} destroy_user_session DELETE /users/sign_out(.:format) {:action=>"destroy", :controller=>"devise/sessions"} user_password POST /users/password(.:format) {:action=>"create", :controller=>"devise/passwords"} new_user_password GET /users/password/new(.:format) {:action=>"new", :controller=>"devise/passwords"} edit_user_password GET /users/password/edit(.:format) {:action=>"edit", :controller=>"devise/passwords"} PUT /users/password(.:format) {:action=>"update", :controller=>"devise/passwords"} cancel_user_registration GET /users/cancel(.:format) {:action=>"cancel", :controller=>"devise/registrations"} user_registration POST /users(.:format) {:action=>"create", :controller=>"devise/registrations"} new_user_registration GET /users/sign_up(.:format) {:action=>"new", :controller=>"devise/registrations"} edit_user_registration GET /users/edit(.:format) {:action=>"edit", :controller=>"devise/registrations"} PUT /users(.:format) {:action=>"update", :controller=>"devise/registrations"} DELETE /users(.:format) {:action=>"destroy", :controller=>"devise/registrations"} login GET /login(.:format) {:controller=>"devise/sessions", :action=>"new"} logout GET /logout(.:format) {:controller=>"devise/sessions", :action=>"destroy"} 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"} projects GET /projects(.:format) {:action=>"index", :controller=>"projects"} POST /projects(.:format) {:action=>"create", :controller=>"projects"} new_project GET /projects/new(.:format) {:action=>"new", :controller=>"projects"} edit_project GET /projects/:id/edit(.:format) {:action=>"edit", :controller=>"projects"} project GET /projects/:id(.:format) {:action=>"show", :controller=>"projects"} PUT /projects/:id(.:format) {:action=>"update", :controller=>"projects"} DELETE /projects/:id(.:format) {:action=>"destroy", :controller=>"projects"} root /(.:format) {:controller=>"home", :action=>"index"} Everything else works as expected, I just cannot get the created user to not be signed in. It's not a huge issue for creating one user, but if I need to create 3 or 4, it's a huge p.i.t. A to have to signout, signin, every single time.

Any help on this is greatly appreciated. Ruby-on-rails ruby-on-rails-3 devise link|improve this question edited Oct 2 '11 at 3:51 asked Oct 2 '11 at 3:16janders22368529.

– cbrauchli Oct 2 '11 at 3:38 Added the rake routes output. – janders223 Oct 2 '11 at 3:52.

On the third line of your routes. Rb file, I think you mean :controllers => …, not :controller => …. You're missing an 's'.

I must have overlooked that a hundred times. Just proves that sometimes it takes and extra set of eyes. Thank you.

– janders223 Oct 2 '11 at 4:53.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions