ruby on rails - Custom devise resource name -
i'm using devise authentication.
i have custom registration controller in api namespace, defined follow:
class api::registrationscontroller < devise::registrationscontroller # ... end
my user model defined outside api namespace follow:
class user < activerecord::base # ... end
in functional tests, put following line in setup devise knows work user
, not api_user
:
@request.env["devise.mapping"] = devise.mappings[:user]
it works great in tests don't know how replicate behaviour in real world.
the sign_up_params
method looks params['api_user']
instead of params['user']
when sanitising.
any idea on how that?
i don't think still need solution went through same problem , solved :
instead of
namespace :api devise_for :users end
in config/routes.rb file, put :
scope :api, module: :api devise_for :users end
hope other people :d
Comments
Post a Comment