Forum: Ruby on Rails Rails erb in inline CSS(in layout file)

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Bcc578efe3bb69e763ec7695d675c06a?d=identicon&s=25 Srinath A. (srinathbtech)
on 2009-02-18 16:17
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;
            }
    </style>
    <div id="header"></div>
        </body>


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 !!
Aafa8848c4b764f080b1b31a51eab73d?d=identicon&s=25 Phlip (Guest)
on 2009-02-18 16:25
(Received via mailing list)
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() ?
D69d23d8e811e8ab2a8593380d6ede63?d=identicon&s=25 Jeff Emminger (jemminger)
on 2009-02-18 16:26
(Received via mailing list)
Exactly as you described should work.

On Feb 18, 10:17 am, "Srinath A." <rails-mailing-l...@andreas-s.net>
Bcc578efe3bb69e763ec7695d675c06a?d=identicon&s=25 Srinath A. (srinathbtech)
on 2009-02-18 16:30
Hi,
but i code like this :

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

this is producing error...


Jeff Emminger wrote:
> Exactly as you described should work.
>
> On Feb 18, 10:17�am, "Srinath A." <rails-mailing-l...@andreas-s.net>
D69d23d8e811e8ab2a8593380d6ede63?d=identicon&s=25 Jeff Emminger (jemminger)
on 2009-02-18 23:13
(Received via mailing list)
I don't think you want to put an image tag there, probably just
something like this instead:


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


On Feb 18, 10:30 am, "Srinath A." <rails-mailing-l...@andreas-s.net>
This topic is locked and can not be replied to.