lucasefe / themes_for_rails

Theme Support for Rails 3
This very same page :)
MIT License
308 stars 102 forks source link

undefined method `theme_image_path' for #62

Open perumal opened 12 years ago

perumal commented 12 years ago

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?

lucasefe commented 12 years ago

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

In a html view works?

perumal commented 12 years ago

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.