How does one load a CSS framework in Rails 3.1?

后端 未结 7 507
甜味超标
甜味超标 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条回答
  •  旧时难觅i
    2020-12-24 07:39

    This blog has the solution I think you're looking for (as I was).

    Don't put the blueprint in app/assets because it will get sucked up in require_tree. Don't put it on public because that's not where assets go. Put it in vendor/assets/stylesheets then include them in application.html.erb before your own application.css as such:

    <%= stylesheet_link_tag 'blueprint/screen', :media => "screen, projection" %>
    <%= stylesheet_link_tag 'blueprint/print', :media => "print" %>
    
    <%= stylesheet_link_tag    "application" %>
    <%= javascript_include_tag "application" %>
    <%= csrf_meta_tags %>
    

提交回复
热议问题