本文介绍了Galleria没有在Heroku的Rails应用中显示出来的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于我的Rails应用程序,我正在使用Galleria -
它所有在本地都可以正常工作,但是当我将应用部署到heroku时,环球免税店已经不在了。



不太确定为什么..

以下是我的代码:

 < div id =galleria> 
<%end%>
< / div>
< script>

Galleria.run('#galleria');
Galleria.configure({
minScaleRatio:1,
maxScaleRatio:1,


});
< / script>
< / div>



.js


  // =需要jquery 
// =需要jquery_ujs
// =需要引导
// =需要galleria-1.2.7
// =需要galleria.classic.min
// = require_tree。

application.css

  * = require_self 
* =需要galleria.classic
* = require_tree。

上面所需的所有文件都在这里:

  app \assets\javascripts 
app \assets\stylesheets

我在我的heroku日志文件中也看不到任何错误,所以我在这里有点迷路。
任何想法为什么它没有显示出来?



谢谢您的宝贵时间!

解决方案

更详细的答案在这里:



我必须在galleria.classic.js中更改此行

  css:'galleria.classic.css',

with

  css:false,

它起作用了!

For my Rails app I'm using Galleria - http://galleria.io/It all works fine locally, but when I deploy the app to heroku, galleria is gone.

Not really sure why..

Here's my code :

   <div id="galleria">
     <% for image in @trip.images %>    
     <%= link_to image_tag(image.image.url(:thumb)), image.image.url(:large), :title => image.title %>
     <% end %>
   </div>
    <script>

     Galleria.run('#galleria');
     Galleria.configure({
         minScaleRatio: 1,
         maxScaleRatio: 1,


    });
    </script>
   </div>

application.js

 //= require jquery
 //= require jquery_ujs
 //= require bootstrap
 //= require galleria-1.2.7
 //= require galleria.classic.min
 //= require_tree .

application.css

*= require_self
*= require galleria.classic
*= require_tree .

All the files being required above are in here :

  app\assets\javascripts
  app\assets\stylesheets

And I don't see any errors in my heroku log files either, so I am bit lost here.Any ideas why it is not showing up ?

Thank You for your time!

解决方案

The answer in more detail is here: Where to put Galleria (jQuery image gallery framework) in Rails 3.1 Asset Pipeline?

I had to change this line in galleria.classic.js

css: 'galleria.classic.css',

with

css: false,

And it worked!

这篇关于Galleria没有在Heroku的Rails应用中显示出来的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-11 00:44