Rails erb in inline CSS(in layout file)


#1

Hi,
How can we call rails erb tag in inline CSS
app/layouts/base_layout.rhtml:

    <body>
<style>
    #header {
        background:

url(http://www.google.ca/intl/en_in/images/logo.gif) no-repeat;
}


I want to replace url(http://www.google.ca/intl/en_ca/images/logo.gif)
with
<%= image_tag(@customer_logo.path_to_logo_image, :width => 250, :height
=> 100) %> with out keeping #header in .css file

any help

thanks !!


#2

Srinath A. wrote:

I want to replace url(http://www.google.ca/intl/en_ca/images/logo.gif)
with
<%= image_tag(@customer_logo.path_to_logo_image, :width => 250, :height
=> 100) %> with out keeping #header in .css file

image_path() ?


#3

Exactly as you described should work.

On Feb 18, 10:17 am, “Srinath A.” removed_email_address@domain.invalid


#4

I don’t think you want to put an image tag there, probably just
something like this instead:

#header { background: url(<%= @customer_logo.path_to_logo_image %>) no-repeat; }

On Feb 18, 10:30 am, “Srinath A.” removed_email_address@domain.invalid


#5

Hi,
but i code like this :

#header { background: url(<%= image_tag(@customer_logo.path_to_logo_image, :width => 250, :height => 100) %>) no-repeat; }

this is producing error…

Jeff Emminger wrote:

Exactly as you described should work.

On Feb 18, 10:17�am, “Srinath A.” removed_email_address@domain.invalid