0

I'm using Rails 3.1 RC. I wanted to load a CSS manually and not via the asset pipeline.

I've tried it like this and with a hand coded tag:

  <%= stylesheet_link_tag "application" %>
  <%= stylesheet_link_tag "/stylesheets/global" %>

For some reason FireBug shows me multiple get requests for the global.css file:

enter image description here

Rails bug? Me being stupid?

If anyone is wondering - I use CSSEdit a lot so couldnt work with the file inside the asset pipeline.

firecall
  • 753
  • 1
  • 8
  • 22

2 Answers2

1

did you set the assets.enabled to false in config/application.rb?

# Enable the asset pipeline
config.assets.enabled = false
house9
  • 20,359
  • 8
  • 55
  • 61
  • No, as I wanted to have some css loaded with the asset-pipeline. I changed the assets.enabled flag to true as you suggested, which worked. But I wanted the pipeline assets loaded, so I changed it back to true, rebooted POW and now it's only loading one instance of global.css. Hmmm :-/ – firecall May 26 '11 at 07:00
0

I would guess this is caused by the same problem as described in Rails 3.1 with Asset Pipeline, link_to :confirm message showing twice?.

You have precompiled assets in your development environment and <%= stylesheet_link_tag "application" %> will expand into multiple tags including each CSS file, one of them being global.css.

Community
  • 1
  • 1
Mattias Wadman
  • 11,172
  • 2
  • 42
  • 57