1

嘿,我想重定向到并保留最后一页的参数。参数是invite_token,但我无法让它工作。

我已经尝试了几个版本:

@invitation = Invitation.find_by_invite_token    
redirect_to sign_up_path(params[:invite_token])
or
redirect_to sign_up_path(params[:invite_token => @invitation.invite_token]
4

2 回答 2

0
redirect_to some_path(invite_token: @invitation.invite_token)
# or
redirect_to controller: :some_controller, action: :create, invite_token: @invitation.invite_token
于 2013-10-08T13:37:15.310 回答
0

通常,如果您需要所有参数保持不变,只需传递params

redirect_to sign_up_path(params)
于 2019-04-18T14:00:59.827 回答