ceth
ceth

Reputation: 45295

Integrate Bootstrap-like framework into Rails application

I would like to use PlusStrap framework into my Rails application. As I see it is a Bootstrap which was slightly customized.

I have included css-file in my layout:

<%= stylesheet_link_tag    "plusstrap.min.css" %>

But when I look at this CSS file I have found such image refs:

background-image: url("../img/glyphicons-halflings.png");

I have created assets/img folder and put image file into it, but Rails cannot find this images. How can I fix it ?

Upvotes: 0

Views: 148

Answers (3)

Alter Lagos
Alter Lagos

Reputation: 12550

If you don't want to modify the css file, you could put it in a folder like app/assets/stylesheets/plusstrap/plusstrap.min.css and the images in app/assets/images/img/ so you'll call the css with:

<%= stylesheet_link_tag "plusstrap/plusstrap.min.css" %>

I know, it could be redundant, but is an effective way if you want to keep your css as the original.

Upvotes: 0

R Milushev
R Milushev

Reputation: 4315

The correct way to include anything , refferenced by CSS's url call is :

background-image: url("/images/yourpic.png")

The Rails framework handles it in a special way....

Upvotes: 1

Simon
Simon

Reputation: 120

Check your folder structure, is it really pointing to the image?. Check the documentation for relative paths in rails.

Upvotes: 0

Related Questions