overriding devise after_sign_up_path_for not working

after_sign_up_path_for device not working
how to override devise
rails devise override
registrationcontroller devise
devise controller
devise redirect on logout
devise registerable
devise rails6

In routes i have the root-path pointing "home#index" but when i try to override that with after_sign_up_path_for keeps redirecting me to the root path when I sign in or sign up. I have tried to put it in both in devise subclassed controller and application_controller, but it didn't work. What do I need to do here?

Application controller

class ApplicationController < ActionController::Base
  protect_from_forgery

  def after_sign_up_path_for(resource)
    show_cities_path(resource)
  end
end

registration controller

class RegistrationsController < ApplicationController
  def after_sign_up_path_for(resource)
    show_cities_path(resource)
  end
end

routes

root :to => "home#index"

Have you checked your show_cities_path exists, by executing rake routes? Might be worth having a look at https://github.com/plataformatec/devise/wiki/How-To:-Change-the-redirect-path-after-destroying-a-session-i.e.-signing-out

ruby on rails, In routes i have the root-path pointing "home#index" but when i try to override that with after_sign_up_path_for keeps redirecting me to the root path when I sign  If you are testing Devise internal controllers or a controller that inherits from Devise's, you need to tell Devise which mapping should be used before a request. This is necessary because Devise gets this information from the router, but since controller tests do not pass through the router, it needs to be stated explicitly.

If you also have the Confirmable module enabled, you have to override after_inactive_sign_up_path_for since a new sign-up is "inactive" until it's confirmed. after_sign_up_path_for doesn't seem to get called when Confirmable is active.

ruby on rails overriding devise after_sign_up_path_for not working , ruby on rails overriding devise after_sign_up_path_for not working? If you also have the Confirmable module enabled, you have to override  In routes i have the root-path pointing "home#index" but when i try to override that with after_sign_up_path_for keeps redirecting me to the root path when I sign in or sign up. I have tried to put it in both in devise subclassed controller and application_controller, but it didn't work.

Although I am late to the game, I just ran into this problem and had trouble finding the solution.

If you are using your own RegistrationsController to customize Devise, then you need to add the after_sign_up_path_for(resource) method to that controller instead of ApplicationController.

In registrations_controller.rb:

private

  def after_sign_up_path_for(resource)
    new_page_path
  end

https://github.com/plataformatec/devise/blob/master/app/controllers/devise/registrations_controller.rb

ruby on rails, If you also have the Confirmable module enabled, you have to override after_inactive_sign_up_path_for since a new sign-up is "inactive" until it's confirmed. When you get “This device was reset. To continue sign in with a Google Account that was previously synced on this device” error, the best option is to contact the seller and ask him to login with his Google Account. Once logged in, you add your own Google account and delete the seller’s account.

I struggled with this problem until realizing I had forgotten to declare that I was overriding devise's registrations controller. In my case, I'm using devise with the :user resource, so I added this to routes.rb:

devise_for :users, :controllers => {:registrations => "registrations"}

After that, the redirect that I specified in after_inactive_sign_up_path_for worked.

Override devise registrations controller has a more complete discussion on this topic, with alternative ways of declaring overrides.

after_sign_up_path_for not being called · Issue #1371 · heartcombo , If I add a couple of debug statements to my code and the devise gem I can see it GitHub is home to over 50 million developers working together to host and It needs to be overridden in the controller as the wikipage says. Delete Partition Override Not Working, How to Solve. As we explained, the command 'delete partition' simply permits you to delete data partitions, while 'delete partition override' comes to play its role when attempting to remove a hidden partition and a protected partition. Unfortunately, many average users don't know such a command totally.

I've just blown about 2 hours on this, but LiveReload was my issue. I was being redirected successfully but LiveReload was picking up the change on development.sqllite and overriding the request.

overriding devise after_sign_up_path_for not working, overriding devise after_sign_up_path_for not working. Question. In routes i have the root-path pointing "home#index" but when i try to override that with  I am trying to use devise_token_auth to add token based authentication for my mobile app. I have a another model in my db which uses devise (but not devise_token_auth).

Hot questions for overriding devise after_sign_up_path_for not , overriding devise after_sign_up_path_for not working / Override devise registrations controller / How do you access Devise controllers? / How to write controller  You can override the default behaviour by creating an after_sign_in_path_for [ RDoc ] method in your ApplicationController and have it return the path for the page you want. There exists a similar method for sign out; after_sign_out_path_for [ RDoc ]

Devise after_sign_up_path_for - how to? - Rails, Hi, I'm new to devise and I'm having a problem overwriting a controller. After sign-​up I want the user to go to a static page. In the controllers  Re: Reducing buffering by changing your Roku's bitrate Jump to solution Ok i have changed my settings and i have even changed my screen resolution from 16:9 widescreen to 4:3 resolution or whatever thats called bc i have a oldschool tv n im talking this 42 in has the big bulky back and true glass on the screen n two ppl are needed to move it

Modifying Authentication Behavior in Devise – Chelsea Troy, For example, devise can generate signup and login views for users, and developers You might be in for some issues. But the way I'm recommending in this post involves overriding def after_sign_up_path_for(resource). If you are building a UI that changes depending on where the user is located, you probably want to make sure that the site behaves correctly in different places around the world. To override your geolocation in Microsoft Edge DevTools: Press Control+Shift+P (Windows) or Command+Shift+P (macOS) to open the Command Menu. Figure 1. The Command Menu

Comments
  • Thank you, that was my issue.
  • Thanks a lot! was having this issue too :D
  • Worth noting that this applies to all cases where a user is inactive for login, for instance if you override active_for_authentication? This includes the confirmable case where the user is inactive for login until they confirm their account.
  • In fact, at the current point in time, you have to note that the method will not be over-ridden by a similarly named method in ApplicationController - you have to declare your own controller for :registrations, in which you need to insert this sole method (after_inactive_sign_up_path_for).
  • Even thought the OP question might have been served better by another answer, this one was the problem I was having!