let admin/announcement works

This commit is contained in:
Wen-Tien Chang 2010-01-04 17:37:55 +08:00
parent 736eda103a
commit 9aeeed140f
1 changed files with 10 additions and 1 deletions

View File

@ -3,11 +3,20 @@ class Announcement
include MongoMapper::Document include MongoMapper::Document
key :title_en, String key :title_en, String
key :title_zh_tw, String
key :content_en, String key :content_en, String
key :content_zh_tw, String key :content_zh_tw, String
def to_liquid def to_liquid
{ "id" => self.id, "title" => self.title, "content" => self.content } { "id" => self.id, "title" => self.send("title_#{I18n.locale}"), "content" => self.send("content_#{I18n.locale}") }
end
def title
self.send("title_#{I18n.locale}")
end
def content
self.send("content_#{I18n.locale}")
end end
end end