I just bought a wrapbootstrap theme and am trying to insert it into my rails application. Some of the css like the padding, navbar, glyphicons, and most of the javascripts are not functioning correctly. I copied all the stylesheets and javascripts into the assets/stylesheets and assets/javascripts respectively. Any idea how to fix these issues?
Asked
Active
Viewed 5,469 times
1 Answers
16
It's a nice collection of themes , indeed . You should first open your css
files and replace all calls to ../img/
dir with plain images/
to make pipeline find the graphic elements of the theme . That's the easy part .
For using the glyphs you should create a new dir under assets , for example fonts
. Then copy the glyphs images there and expand the usable assets in application.rb
file , like this :
config.assets.paths << Rails.root.join("app", "assets", "fonts")
After that , you should rename your font-awesome.css
to font-awesome.css.scss.erb
and change the @font-face
declaration in it like this :
@font-face {
font-family: "FontAwesome";
src: url('<%= asset_path('fontawesome-webfont.eot')%>');
src: url('<%= asset_path('fontawesome-webfont.eot?#iefix')%>') format('eot'), url('<%= asset_path('fontawesome-webfont.woff')%>') format('woff'), url('<%= asset_path('fontawesome-webfont.ttf')%>') format('truetype'), url('<%= asset_path('fontawesome-webfont.svg#FontAwesome')%>') format('svg');
font-weight: normal;
font-style: normal;
}
If I've missed some small part, it is because of the Saturday night red wine ... Do not hessitate to ask for more details .

R Milushev
- 4,295
- 3
- 27
- 35