문제

I am using Ruby on Rails 4 on RubyMine 6. I have a somefile.css.scss.erb file in app/assets/stylesheets/somefolder. I am using SCSS and I need ERB to use asset_url helper to write paths for background properties.

The problem is that when I use both SCSS and ERB extensions I get "cannot find variable" warning everywhere I use SCSS variables(In uses but not in initializations). Is there any way to make RubyMine parse .scss.erb files correctly?

It works fine. I'm just not comfortable with these warnings.

도움이 되었습니까?

해결책

You don't need to do that. Just rename the file to somefile.css.scss and use the SCSS image-url helper.

image-url("rails.png")

is translated into

url(/assets/rails.png)
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top