我在将 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>
当我刷新页面时,没有显示任何图像。最重要的是,我收到以下错误消息:
致命错误:/root/rails_project/sample_app/app/assets/javascript/galleria.classic.min.js 的主题无法加载,请检查主题路径。
请帮我弄清楚我的文件到底放在哪里。
提前致谢!