diff --git a/app/models/theme_asset.rb b/app/models/theme_asset.rb index 1891e432..4d87ff0c 100644 --- a/app/models/theme_asset.rb +++ b/app/models/theme_asset.rb @@ -71,7 +71,7 @@ class ThemeAsset def plain_text if RUBY_VERSION =~ /1\.9/ - @plain_text ||= self.source.read.force_encoding('UTF-8') + @plain_text ||= (self.source.read.force_encoding('UTF-8') rescue nil) else @plain_text ||= self.source.read end diff --git a/app/views/admin/assets/_form.html.haml b/app/views/admin/assets/_form.html.haml index 53f5dfe4..7c88c3f5 100644 --- a/app/views/admin/assets/_form.html.haml +++ b/app/views/admin/assets/_form.html.haml @@ -6,7 +6,7 @@ = f.input :name = f.input :source -- unless @asset.custom_fields.empty? +- unless @asset.custom_fields.blank? = render 'admin/custom_fields/custom_form', :form => f, :title => :other_fields, :parent => @asset_collection - if @asset.image? && @asset.valid?