Setup devise with custom registration controller

橙三吉。 提交于 2020-01-23 07:06:06

问题


I'm working on a rails site using devise, where we do not want user sign ups just yet. User authentication is so we can login to access restricted parts of the site and add/edit things as we see fit. So for now, I created the following controller:

class Users::RegistrationController < Devise::SessionsController
  def new

  end
end

And setup my routes in this fashion:

devise_for :users, :controllers => { :registration => "users/registration" }

However, when I run rake routes, I still see a returned value for the create action on the registration controller. Any ideas on how to get rid of it?


回答1:


Try using :registrations instead of :registration. Also, it seems like your custom controller class should be defined via:

class Users::RegistrationsController < Devise::RegistrationsController


来源:https://stackoverflow.com/questions/7315012/setup-devise-with-custom-registration-controller

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!