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