我有一个名称列表,其中包含:
<td><%= product.date %></td>
它在我的索引页中。(这是我的应用程序列表)
我想为其分配一个自定义链接,并将该值传递给控制器:我试过这个:
<td><%= link_to product.date, {:controller => "product", :action => "sort_by_date", <how do I pass the 'product.date' string?> }%></td>
我阅读了 rails 路线指南,但找不到帮助
谢谢
什么耙路线返回:
products GET /products(.:format) products#index
POST /products(.:format) products#create
new_product GET /products/new(.:format) products#new
edit_product GET /products/:id/edit(.:format) products#edit
product GET /products/:id(.:format) products#show
PUT /products/:id(.:format) products#update
DELETE /products/:id(.:format) products#destroy
root /
products#home.html