这是我所拥有的一张桌子的视图:
<% @campaign_events.each do |campaign_event| %>
<% model_name = campaign_event.class.name.tableize.singularize %>
<tr class="<%= cycle( oddrow , evenrow ) %>">
<td><%= link_to campaign_event.title, send("#{model_name}_path", campaign_event) %></td>
<td><span class= model_name ><%= model_name.capitalize %></span>
<td><center><%= campaign_event.days %></center></td>
<td><center><%= campaign_event.count_sent%></center></td>
</tr>
<% end %>
</table>
@campaign_events可以包含几个不同Model对象的数组:Email、Call、Postalcard等。
我希望能够编辑campaign_event.days中的值。
我希望能够使用某种插件,而不是手工编码,因为我需要使许多其他视图就地可编辑。
但我不知道该如何开始。这是一个关键的开始。