Slidedeck jquery プラグインを含むサイトがあります。ローカルで提供すると、問題なく動作し、見栄えがします。しかし、Herokuにプッシュした後、まったく機能しません。
スプロケットを使用してすべてのファイルを含めています。また、テーマを処理する gem (themes_for_rails) も使用しています。config に初期化子があります。
ThemesForRails.config do |config|
# themes_dir is used to allow ThemesForRails to list available themes. It is not used to resolve any paths or routes.
config.themes_dir = ":root/app/assets/themes"
# assets_dir is the path to your theme assets.
config.assets_dir = ":root/app/assets/themes/halo"
# views_dir is the path to your theme views
config.views_dir = ":root/app/views/themes/halo"
# themes_routes_dir is the asset pipeline route base.
# Because of the way the asset pipeline resolves paths, you do
# not need to include the 'themes' folder in your route dir.
#
# for example, to get application.css for the default theme,
# your URL route should be : /assets/default/stylesheets/application.css
config.themes_routes_dir = "assets"
end
これは私のapplication.jsにあります:
//= require jquery
//= require jquery_ujs
//= require_tree .
//= require_tree ../themes/halo/javascripts
多分私の問題は、Heroku で相対パスを使用していることです。ただし、絶対パスを実行する方法が正確にはわかりません。