How does one load a CSS framework in Rails 3.1?

后端 未结 7 502
甜味超标
甜味超标 2020-12-24 07:03

I am trying to load a CSS framework, Blueprint, onto my Rails 3.1 application.

In Rails 3.0+, I would have something like this in my views/layouts/application.html.e

7条回答
  •  失恋的感觉
    2020-12-24 07:29

    If anyone else is wondering how I did it in the end.

    I removed

     *= require_tree .
    

    My app/assets/stylesheets/application.css, now looks like:

    /*
     * This is a manifest file that'll automatically include all the stylesheets available in this directory
     * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
     * the top of the compiled file, but it's generally better to create a new file per style scope.
     *= require_self
     *= require 'blueprint/screen'
     *= require 'colorbox/colorbox'
     *= require 'uploadify'
     *= require 'scaffold'
     *= require 'main'
    */
    

    And in app/views/layouts/application.html.erb, I have:

    
    
      <%= yield(:title).present? ? yield(:title) : 'Foobar' %>
      <%= favicon_link_tag %>
    
      <%= stylesheet_link_tag    'application' %>
      <%= javascript_include_tag 'application' %>
    
      <%= stylesheet_link_tag 'blueprint/print', 'media' => 'print' %>
    
      
    ...
    

    Hope this helps someone.

提交回复
热议问题