Rails 3:Link_to列表项?
我有一些按钮,基本上用CSS覆盖
链接链接到Rails操作。
所以我不想这样做:
"update", :id => @id, :response => index }, :remote => true %>
我想做这样的事情:
<%= link_to choice , { :action => "update", :id => @id, :response => index }, :remote => true %>
使用html_safe
<%= link_to "choice ".html_safe, { :action => "update", :id => @id, :response => index }, :remote => true %>
使用块
<%= link_to {...} do %> choice <% end %>
请注意rails 3.x使用<%=
但rails 2.x使用<%