4
我在將Galleria與我的Rails應用程序集成時遇到問題。這裏是處理:集成Galleria與Rails應用程序
這些都是我的文件位置:
/root/rails_project/sample_app/app/assets/stylesheets/galleria.classic.css.scss
/root/rails_project/sample_app/app/assets/javascript/galleria-1.2.7.min.js
/root/rails_project/sample_app/app/assets/javascript/galleria-1.2.7.min.js
/root/rails_project/sample_app/app/assets/javascript/galleria.classic.js
/root/rails_project/sample_app/app/assets/javascript/classic-loader.gif
/root/rails_project/sample_app/app/assets/javascript/classic-map.png
在我application.css,我已經加入這一行:
*= require galleria.classic
在我的application.js,我添加這一行:
//= require galleria-1.2.7
//= require galleria.classic
最後,這恰好是我的視圖文件:
<h1>Displaying Photos</h1>
<script src="/root/rails_project/sample_app/app/assets/javascript/galleria-1.2.7.min.js"></script>
<div id="abc">
<% @pictures.each do |picture| %>
<% if (picture.tag).include? @tag %>
<ol class="microposts">
<li id="<%= picture.id %>">
<span class="content">
<%= image_tag picture.photo.url(:medium) %>
</span>
</li>
</ol>
<% end %>
<% end %>
</div>
<script>
Galleria.loadTheme('/root/rails_project/sample_app/app/assets/javascript/galleria.classic.min.js');
Galleria.run('#abc');
</script>
當我刷新我的頁面時,沒有顯示任何圖像。最重要的是,我收到以下錯誤信息:
Fatal error: Theme at /root/rails_project/sample_app/app/assets/javascript/galleria.classic.min.js could not load, check theme path.
請幫我拿出放置文件的位置。
在此先感謝!
感謝很多人。這對我有效。自上午以來,我一直在做這麼多事情。似乎沒有任何工作。還有一個問題 - 目前,我已將我的JS和CSS文件分別放在供應商/資產/ javascript和供應商/資產/樣式表中。沒關係,或者我應該將它們移回應用程序/資產。我有資產流水線啓用。 – 2012-07-09 13:25:34
沒關係http://guides.rubyonrails.org/asset_pipeline.html – NARKOZ 2012-07-09 13:35:55