Saturday 15 September 2012

twitter bootstrap - Using boostrap.css file in Rails production/heroku w/o LESS or SASS -


I am trying to use the glyphikon provided by Bootstrap in my Rail 4.0beta1 app. Everything works well in the field of development, but nothing is available in the production, and in its lock I get the following error:

  ActionController :: routingError No root matches [GET] "/ Assets / glyphicons- Halflings.png "  

In this way I am calling the image file Burrtranslation:

  [class ^ =" icon-"] , [Class * = "icon-"] {background-image: url ("/ property / glyphikon-arlingling page"); }   

In this way I am providing it in the scene:

  & lt; I class = "icon-user" & gt; & Lt; / I & gt;   

When I run the rake property: precompile and the production server start with the rail S -E output, then I can no longer see the icon. I'm not sure why this is the case. I am not using a gem connected with bootstrap, I have an image file under the plain bootstrap.css file and property / images.

Edit: I also added one. The erb extension (bootstrap.css.erb) to use the Asset_path assistant, but I still do not see the mark, the output in the development.

Anyone have any ideas?

Well, oddly, background-image does not seem to work in production. I was just loading other background images using the background: property, so I tried and now it works in (magical) production:

  background: url (& lt; % = Asset_path 'glyphicons-halflings .png'% & gt;);   

Bootstrap.css.erb as file name.

Why is the background image still working in development, but is not confused as production ...

No comments:

Post a Comment