これを修正するために非常に多くの代替手段を試しましたが、他に何をすべきかわかりません。Ruby 1.9.3p362 (2012-12-25 リビジョン 38607) と Rails 3.2.8 を使用しています。
私のホームページは Safari では問題なく表示されますが、Chrome や Firefox で読み込もうとすると多くの問題が発生します。ここのサイトを参照してください。IEの混乱を想像することしかできません。
更新 - 問題は次のとおりです。
- 一部の画像が表示されない
- 表示される画像は css クラスに応答しません
- 画像のアドレス (appaddress/assets/image_name.jgp) をたどろうとすると、Chrome では画像リンクが壊れ、Firefox では「この画像にはエラーが含まれているため表示できません」というメッセージが表示されます。
ただし、これらの画像はすべて Safari できれいに動作します。
ビュー ファイルは次のとおりです (関連する部分のみ)。
<div class="masthead">
<h1 align="center"> <%= image_tag "logoBW6.png", class: "header-image" %></h1>
</div>
<div class="span6 image-overlay">
<h3 align="center">
<%= cl_image_tag(@blogs.first.image, :transformation =>[
{ :width => 650, :height => 615, :crop => :fill,
:gravity => :south}]) %></h3>
<a href=<%= blog_path(@blogs.first) %>><h2 align="left" class="overlay overlay-background"><%= image_tag "empty_banner.png" %></h2><h2 class="overlay text-overlay"><%= @blogs.first.title%></h2></a>
<br /><%= @blogs.first.post.first(50) %>...
</div>
<div class="span6 image-overlay">
<h3 align="center">
<%= cl_image_tag(@blogs.first(2)[1].image, :transformation =>[
{ :width => 650, :height => 615, :crop => :fill,
:gravity => :south}]) %></h3>
<a href=<%= blog_path(@blogs.first(2)[1]) %>><h2 align="left" class="overlay overlay-background"><%= image_tag "empty_banner.png" %></h2><h2 class="overlay text-overlay"><%= @blogs.first(2)[1].title%></h2></a>
<br /><%= @blogs.first(2)[1].post.first(300) %>...
</div>
</div>
</div>
アプリケーション.rb:
require File.expand_path('../boot', __FILE__)
require 'rails/all'
require 'csv'
if defined?(Bundler)
# If you precompile assets before deploying to production, use this line
Bundler.require(*Rails.groups(:assets => %w(development test)))
# If you want your assets lazily compiled in production, use this line
# Bundler.require(:default, :assets, Rails.env)
end
module Chic
class Application < Rails::Application
config.encoding = "utf-8"
config.filter_parameters += [:password]
config.active_support.escape_html_entities_in_json = true
config.active_record.whitelist_attributes = true
config.assets.enabled = true
config.assets.version = '1.0'
config.assets.initialize_on_precompile = false
config.assets.prefix = "/assets"
end
end
プロダクション.rb
Chic::Application.configure do
config.cache_classes = true
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
config.serve_static_assets = true
config.assets.compress = true
config.assets.compile = true
config.assets.digest = true
config.i18n.fallbacks = true
config.active_support.deprecation = :notify
config.action_mailer.default_url_options = { host: "thenewoutfitproject.com" }
config.action_mailer.raise_delivery_errors = true
config.action_mailer.delivery_method = :ses
end
どんな提案でも大歓迎です!!!
ありがとう!サム