Skip to content

Using in a Rails app

respinos edited this page Jul 31, 2017 · 5 revisions

Within your applications Gemfile:

gem 'cozy-sun-bear', git: 'https://github.com/mlibrary/cozy-sun-bear'

Or, if you're using a particular branch:

gem 'cozy-sun-bear', git: 'https://github.com/mlibrary/cozy-sun-bear', branch: 'particular-branch'

Then, in application.js, add:

*= require cozy-sun-bear-main

And, if you're incorporating the default cozy-sun-bear styles, in application.scss, add:

//= require cozy-sun-bear-main

Configuring the EPUB engine

In application.rb:

module YourApp
  class Application < Rails::Application
    config.cozy_epub_engine = 'epubjsv2'
  end
end

If you change the cozy_epub_engine configuration, you need to run bundle exec rake tmp:cache:clear for the change to be picked up. Restarting your Rails app is not sufficient.

Clone this wiki locally