I feel like my brain left the building when I was learning Rails routing... I can't figure this out.
So I have customized some devise controller, and therefore I have updated the route file like so:
devise_for :users, controllers: {
registrations: "users/registrations",
sessions: "users/sessions",
passwords: "users/passwords"
}
That works GREAT. It gives me paths like this:
new_user_registration GET /users/sign_up(.:format) users/registrations#new
The challenge now is I want to run an A/B test using Google Analytics where I need 2 more pages for the sign up.
So in my controller this is how I would modify:
class Users::RegistrationsController < Devise::RegistrationsController
def new
end
# ADD BELOW
def new_control
end
def new_test
end
end
But I can't figure out how to modify my routing so that I have these 2 new routes in additional to the old new_user_registration_path
(note the named path helper for these new ones don't matter so much to me because I never actually use it)
GET /users/sign_up/control(.:format) users/registrations#new_control
GET /users/sign_up/test(.:format) users/registrations#new_test
Note that I want to keep all the other lovely routes the devise_for
code has created, e.g., the create
and edit
actions