Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我目前有一个这样的按钮:
= button_to "Go Back" , mobile_disclosures_url , :method => :get
但是我不确定要给它什么路径才能使浏览器返回。有什么帮助吗?:)
谢谢!
您必须将 JS 用于基于浏览器的真实向后导航。
= button_to "Go Back", '#', :onclick => 'history.back(); return false;'
从记忆中,我认为适用于button_to,但它绝对应该适用于link_to.
button_to
link_to
=link_to "Go Back", :back
它会将链接设置为 REFERER 标头