如何在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