themes_for_rails icon indicating copy to clipboard operation
themes_for_rails copied to clipboard

undefined method `theme_image_path' for

Open perumal opened this issue 12 years ago • 2 comments

Hi, I am getting undefined method theme_image_path' for and undefined methodcurrent_theme_image_path' for When I used them inside .css.erb files

What could be the problem here?

perumal avatar Aug 01 '12 12:08 perumal

Never tried that, so I don't know if its supported.

In a html view works?

lucasefe avatar Aug 01 '12 16:08 lucasefe

Hi lucasefe,

Yes it perfectly works inside .html.erb files

If it is not supported inside .css.erb files then please tell me how are we suppose to use the themes specific assets like images inside the theme specific css files

I tired to do this by as mentioned in the below code

#box { padding-top: 10px; background: url('<%= current_theme_image_path("contactus.jpg") %>'); }

The above code gives me undefined method current_theme_image_path

But If I try to use normal rails asset_path instead of current_theme_image_path then asset_path expands to /assets/contactus.jpg, which is not where my contactus.jpg is, The actual image file is in /app/assets/themes/theme-name/images/contactus.jpg

Please help me. Is there anything wrong in my understanding. Point me to the right way of including theme specific images in theme specific css files.

perumal avatar Aug 01 '12 19:08 perumal