且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Rails - 获取不带 GET 参数的当前 url

更新时间:2023-01-27 14:31:34

request.path 如果您不关心主机名,应该返回您要查找的内容.否则你可以试试:

request.path should return what you're looking for if you're not concerned about the hostname. Otherwise you might try:

url_for(:only_path => false, :overwrite_params=>nil)