Trying nokogiri

This commit is contained in:
Christophe Vilayphiou committed 2012-03-27 18:42:22 +08:00
1 parent f9c5ee5d18
commit f5fd3dec7a
10 files changed
+172 -75

No files matched your search

+6 -2
View File
@@ -2,6 +2,8 @@ class Layout < DesignFile
include ParserLayout
attr_reader :content
field :body
embeds_one :menu
embedded_in :design
@@ -17,8 +19,10 @@ class Layout < DesignFile
Layout.count > 0
end
def parse_layout
parse_layout_contents(self)
def parse_layout
html = Nokogiri::HTML(self.file.read)
self.body = html.at_css("body").inner_html
parse_body(self)
end
end