如何在link_to
块声明中实现查询字符串和URL参数?现在,我有这个,它的工作原理:Rails:link_to与块和GET参数?
<%= link_to 'Edit', :edit, :type => 'book', :id => book %>
上述工作,输出:
http://localhost:3000/books/edit/1?type=book
我想要做的是这样的:
<% link_to :edit, :type => 'book', :id => book do %>
...
<% end %>
但以上格式输出:
http://localhost:3000/books/edit/
这是不是我正在寻找的...我希望它输出一个像上例那样的URL。
我该如何做到这一点?
块似乎是捕获输入'标签'内放置的方式。 http://railsapi.com/doc/rails-v2.3.5/classes/ActionView/Helpers/UrlHelper.html#M002452 – 2010-04-26 07:07:54