Browse files

Tweak the #content helper to properly handle image assets.

  • Loading branch information...
1 parent 07c738d commit ec04433f989f9a9de506ac12b4cc552052b5f3b8 @lukesutton lukesutton committed Aug 28, 2012
Showing with 2 additions and 2 deletions.
  1. +1 −1 app/helpers/islay/public/application_helper.rb
  2. +1 −1 app/models/page.rb
View
2 app/helpers/islay/public/application_helper.rb
@@ -20,7 +20,7 @@ def content(name, content, opts = {})
when :markdown then render_markdown(config[:value], opts[:level] || 1)
when :text then simple_format(config[:value])
when :string then config[:value]
- when :image then version_image_tag(config[:value], opts[:version])
+ when :image then version_image_tag(config[:value].asset, opts[:version]) if config[:value]
end
end
end
View
2 app/models/page.rb
@@ -43,7 +43,7 @@ def each
#
# @return Hash
def content_with_config(name)
- definition.contents[name.to_sym].merge(:value => entries[name.to_s])
+ definition.contents[name.to_sym].merge(:value => contents[name])
end
# The contents defined against the page. For any contents that are missing,

0 comments on commit ec04433

Please sign in to comment.