mardi 14 février 2017

The route.rb doesn't point to my custom RegistrationController

i build a ruby on rails app base on dookeeper and devise and now I'm going to change the default RegistrationController that is in Devise::RegistrationsController which made by default on ruby to the custom one that i made in a folder api/users/registrationController. i tried several ways one of is this:

devise_for :users,
      only: :registrations,
      controllers: {
        registrations: 'api/users/RegistrationsController'
      }

but i get error that says this:

'api/RegistrationsController' is not a supported controller name. This can lead to potential routing problems. See http://ift.tt/ORFiAT

the ways that i declare the RegistrationController is like this:

class RegistrationsController < Devise::RegistrationsController
    respond_to :json
end

of course i made some method in like create in this file file but when i send post request like localhost:3000/users and a json file it refer me to this class class Devise::RegistrationsController < DeviseController and check whole process here.

Aucun commentaire:

Enregistrer un commentaire