0
在我看来,我想使用link_to_unless_current在页面上创建“/ payforms”链接。但是,当我传递参数时,例如,“/ payforms?submitted = true”,该函数仍然认为我处于“当前”状态,并且不会创建链接。有没有办法让我检查是否没有参数?如何在rails中创建没有params的链接?
<%= link_to_unless_current "All", payforms_path %>
也许是这样的?
<%= link_to_unless_current "All", payforms_path(:params => nil)
其实,这个问题是不正确 - 我正在寻找一种方法,如果params为空。在rails中有这样的函数吗? – ehfeng 2010-06-24 19:59:13
它工作!非常感谢。 – ehfeng 2010-06-24 22:17:08