rctneil
rctneil

Reputation: 7210

Bower and Rails Asset Pipeline Import

I have used Bower to install a selection of components into my Rails app.

The components are in /app/vendor/assets/components

I have installed the hidpi scss file and that lives at:

/app/vendor/assets/components/sass-hidpi/_hidpi.scss

Now, I need to get that scss file imported into my main application.css.sass file which lives in /app/assets/stylesheets

I have tried:

@import url(<%= asset_path '_hidpi.scss' %>)

by adding .erb onto the end of my application.css.sass file but that just outputs:

@import "/assets/_hidpi.scss" in my compiled stylesheet which obviously is wrong.

How can I get the file imported and compiled without moving it from the components directory that bower installs to?

Upvotes: 0

Views: 1494

Answers (1)

flyingjamus
flyingjamus

Reputation: 4023

You can try adding the following to config/application.rb, inside the class Application < Rails::Application block:

config.sass.load_paths << File.expand_path('../../vendor/assets/components/')

from SASS, Rails 3.1: Loading stylesheets in vendor/assets

Upvotes: 3

Related Questions