我想有两个额外的变量创建一个简单的link_to(轨道3):LINK_TO额外变量
= link_to 'Try', new_try_path(:k => users.collect{|m| m.user.username}, :h=> users2.collect{|m| m.user2.username2}, :proof => true)
问题是如果users2为空,则生成此HTML代码:&k=[1]&&proof=true
我尝试过这样的事情。你能帮我吗?
= link_to 'Try', new_try_path(:k => users.collect{|m| m.user.username}, :h=> users2.collect{|m| m.user2.username2} if users2.blank?, :proof => true)
谢谢!