0

我在我的應用程序上實現了設計創意,我想在sign_up之後重定向到特定路徑。我在registration_controller.rb中有此方法,但它不起作用,它將重定向到根路徑而不是指定的路徑。我也有devise :confirmable成立,但我延遲發送確認電子郵件,直到後來。在註冊之後和確認之前設計重定向路徑

def after_sign_up_path_for(resource) 
    new_transaction_path(session[:registration_params]) 
end 

並返回以下閃光燈通知:translation missing: en.devise.registrations.store.signed_up_but

我怎樣才能使這項工作?

+0

什麼是會議的下列[:registration_params]?可能你需要傳遞資源 – Vishal

+0

你也可以試試def'after_inactive_sign_up_path_for(resource) new_transaction_path(resource) end' – Vishal

+0

感謝你的回覆@Vishal ....我在查詢字符串中添加參數到一個路徑它是new_store_registration,並在store_registration控制器中點擊新操作時將它們存儲在會話中,然後在after_sign_up_path_for方法中檢索它們。 – Theopap

回答

0

您必須在另一個文件中使用該方法。嘗試在項目範圍內搜索after_sign_in_path_for。我的應用程序控制器中有以下工作:

class ApplicationController < ActionController::Base 
    def after_sign_in_path_for(*) 
    cms_path 
    end 
end 

其中cms_path是我的路由文件中的命名路由。如果你的不工作,你必須騎在別的地方。

0

我得到這個通過增加工作的registration_controller.rb

def after_inactive_sign_up_path_for(resource) 
    new_transaction_path(session[:registration_params]) 
end