diff --git a/app/models/page.rb b/app/models/page.rb index be51c35c..4e9f87ff 100644 --- a/app/models/page.rb +++ b/app/models/page.rb @@ -1,7 +1,7 @@ class Page < Item field :content - field :theme_id + field :theme_id, :type => BSON::ObjectId belongs_to :design has_many :page_parts diff --git a/lib/parser.rb b/lib/parser.rb index d55b3cdf..c8fc1940 100644 --- a/lib/parser.rb +++ b/lib/parser.rb @@ -66,10 +66,8 @@ module Parser c.define_tag 'stylesheets' do |tag| res = '' res << " " - page.design.themes.each do |theme| - res << " " - end - res + theme = page.design.themes.detect{ |d| d.id == page.theme_id } + res << "" end c.define_tag 'javascripts' do |tag| res = '' @@ -171,10 +169,8 @@ module Parser c.define_tag 'stylesheets' do |tag| res = '' res << "" - page.design.themes.each do |theme| - res << "" - end - res + theme = page.design.themes.detect{ |d| d.id == page.theme_id } + res << "" end c.define_tag 'javascripts' do |tag| res = ''