开发者

How do I cause a browser redirect from a gem?

开发者 https://www.devze.com 2023-03-18 08:22 出处:网络
I\'m creating a gem and I was wondering how I can add a browser redirect. For example, if a class method from the gem is called in a Rails controller, the browser will redirect to a new url.

I'm creating a gem and I was wondering how I can add a browser redirect. For example, if a class method from the gem is called in a Rails controller, the browser will redirect to a new url.

I can only seem to launch a URL in a n开发者_开发百科ew tab/window. In Rails I would call a simple redirect_to but I'm not sure of how to do this in Ruby alone.

0

精彩评论

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