How to use Galleria plugin with Rails 4 Pipeline

前端 未结 2 1870
礼貌的吻别
礼貌的吻别 2021-02-10 05:07

I\'ve recently had a trouble making Galleria plugin work with Rails 4 Pipeline and it took me a while to figure out how to make it work, so I wanted to share the solution in cas

2条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-10 06:02

    I've just used this in Rails 4.1 as well with Galleria version 1.3.5. Copy the files from the main galleria folder into the various parts. Note that I'm using the classic/default (free) theme.

    # app/assets/images
    classic-loader.gif
    classic-map.png
    
    # app/assets/javascripts
    galleria-1.3.5.js
    galleria.classic.js
    
    # app/assets/stylesheets (rename with .scss extension)
    galleria.classic.css.scss
    

    Open up galleria.classic.js and edit the line css: '...' to be css: false (around line 17 if you don't alter the code).

    That's all I had to do in order to get it working with Rails 4. I played around with placing the files in the vendor/assets folders, but that became a nightmare fairly quickly. I found the above solution to be the simplest/cleanest.

    Update: 2016-02-02

    I'm still using this same setup with a Ruby 2.2.3, Rails 4.2.4, Galleria 1.4.2 setup.

    Make sure in your galleria.classic.scss stylesheet you use the image-url("classic-map.png") helpers. No problems with this current setup.

提交回复
热议问题