4
我有這樣的代碼在Rails 3應用程序我正在:link_to中的method =>'delete'在Rails 3中似乎不起作用?
<% @positions.each do |position| %>
<tr class="<%= cycle("", "alternate") %>">
<td><%= position.name %></td>
<td class="actions">
<%=link_to 'edit', edit_position_path(position), :class => 'edit' %> |
<%=link_to 'delete', position_path(position), :confirm => 'Are you sure you want to delete this item?', :method => 'delete' %>
</td>
</tr>
<% end %>
編輯鏈接的作品很好,但刪除鏈接一直帶我去表演動作。
任何想法是什麼問題? PS:我使用formtastic與Mongoid並列,ActiveRecord未加載到我的config/application.rb文件中。
還沒有嘗試過,但如果它是真的,那麼它就會讓我覺得必須在所有Rails項目中包含javascript文件才能獲得基本的Restful功能。呸。 – concept47 2010-08-23 06:37:08