开发者

Pass URL parameters to a redirect_to :root

开发者 https://www.devze.com 2023-02-18 23:39 出处:网络
This is probably a really dumb question, but it\'s virtually impossible to google the answer... Is it possible (and if so how...) to do something like:

This is probably a really dumb question, but it's virtually impossible to google the answer...

Is it possible (and if so how...) to do something like:

redirect_to :root, :registered => true

Which would then link to http://myurl.com/?registered=true

The root url seems to strip all params. All I need it for is to track sign-ups via Google Analytics (I know I should probably be sending people to a thank-you page instead, but in this particular case - it makes more sense this way)

For this reason too - I don't want to redirect to something like:

:开发者_StackOverflowcontroller => :pages, :action => :home, :registered => true

As this will mess up both the analytics and SEO etc...

Thanks in advance.


You should be able to do:

 redirect_to root_path(:registered => "true")
0

精彩评论

暂无评论...
验证码 换一张
取 消