Search code examples
ruby-on-railstwitter-bootstraprefinerycms

Using bootstrap for administrative backend in RefineryCms


I want to use bootstrap for my edition pages.

I had installed already the gems for using bootstrap and they work pretty good for my site pages.

gem 'refinerycms-bootstrap'

gem 'bootstrap-sass'

But when I try of use the bootstraps classes for my backend edit form... they are not included.

How I can include the bootstrap for my backend pages?

Thanks


Solution

  • I finally did it.

    Open the file

    config/initializers/refinery/core.rb

    uncomment the lines

    # Register extra javascript for backend

    config.register_javascript "custom"

    # Register extra stylesheet for backend (optional options)

    config.register_stylesheet "custom", :media => 'screen'

    Then I go to the path vendor/assets/stylesheets and I created the file custom.css.scss and the path vendor/assets/javascripts I created the file custom.js

    custom.css.scss

    @import "bootstrap";
    

    custom.js

    //= require bootstrap
    

    Then I created the file config/initializers/assets.rb with this content

    Rails.application.config.assets.precompile += %w( custom.css )
    Rails.application.config.assets.precompile += %w( custom.js )
    

    Restart rails server

    Now I must to fix some visual issues.