2
<% @recently_active_objects = Activity.find(:all, :limit => 10, :order => "id DESC") %>
<% @recently_active_objects.group_by{ |object| object.created_at.midnight }.each do |day, objects| %>
<h3><%= day.strftime("%A, %B %e") %></h3>
<% objects.each do |object| %>
<%= activity_message_for_activity(object) %>
<% end %>
<% end %>
在這種情況下,您如何本地化day.strftime
?本地化strftime rails 2.2
呃你在你的例子中仍然有strftime。這是故意的嗎? – 2009-11-25 11:11:34
不,這是一個錯誤。固定。 :) – 2009-11-25 11:14:45
我試過這樣並得到:無法將數組轉換爲字符串.. – 2009-11-25 14:30:47