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 !!
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
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 fileimage_path() ? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Exactly as you described should work. On Feb 18, 10:17 am, "Srinath A." <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> 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 !! > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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>
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
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...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:> 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...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
>
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---