I''m having a problem generating this HTML is my _header.rhtml. <div class="cssnav"><a href="/" title="Home"><img src=''/images/ over.jpg'' alt=''label''><span>Home</span></a></div> I know I need to use the link_to and image_tag but I have not been able to generate the <span> This is the basic code <div class="cssnav"> <% if request.path_parameters[''controller''] == "home"%> :controller => ''home'', :action => ''index'' <% end % </div> --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 8/27/07, Mark <mark-h9LRGznmPqMAvxtiuMwx3w@public.gmane.org> wrote:> > I''m having a problem generating this HTML is my _header.rhtml. > > <div class="cssnav"><a href="/" title="Home"><img src=''/images/ > over.jpg'' alt=''label''><span>Home</span></a></div> > > I know I need to use the link_to and image_tag but I have not been > able to generate the <span>link_to(image_tag(''image_file_name''), content_tag(''span'', ''link location'')) --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
mark-h9LRGznmPqMAvxtiuMwx3w@public.gmane.org
2007-Aug-27 17:57 UTC
Re: How to I generate a <span> tag
First, thanks for the help!
When I try using content_tag(''span'', ''Home)) it wraps
the output in my <a> with quotes.
<a href="<span>Home</span>">
----- Original Message ----
From: Adam Cohen <bionicboogie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Sent: Monday, August 27, 2007 11:53:49 AM
Subject: [Rails] Re: How to I generate a <span> tag
On 8/27/07, Mark <mark-h9LRGznmPqMAvxtiuMwx3w@public.gmane.org>
wrote:>
> I''m having a problem generating this HTML is my _header.rhtml.
>
> <div class="cssnav"><a href="/"
title="Home"><img src=''/images/
> over.jpg''
alt=''label''><span>Home</span></a></div>
>
> I know I need to use the link_to and image_tag but I have not been
> able to generate the <span>
link_to(image_tag(''image_file_name''),
content_tag(''span'', ''link location''))
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---