complete new parser for layout_part

This commit is contained in:
Kaito committed 2011-08-10 17:28:10 +08:00
1 parent 278938a52d
commit 34d0b8fac1
5 files changed
+37 -7

No files matched your search

+8 -1
View File
@@ -1,5 +1,5 @@
class Layout < DesignFile
include Parser
embedded_in :design
attr_reader :content
@@ -8,7 +8,14 @@ class Layout < DesignFile
def content
self.file.read
end
def self.exist_one?
Layout.count > 0
end
after_save:parse_layout
def parse_layout
parse_layout_layout_part(self)
end
end
+5 -2
View File
@@ -3,9 +3,12 @@ class LayoutPart
include Mongoid::Document
include Mongoid::Timestamps
field :name
field :name_tag
field :id_tag
field :editable_tag
field :class_tag
field :content
belongs_to :layout
end
end