# How to I generate a \<span\> tag

**URL:** <https://www.ruby-forum.com/t/how-to-i-generate-a-span-tag/113100>\
**Category:** Rails\
**Created:** [August 27, 2007, 5:24pm UTC](https://www.ruby-forum.com/t/how-to-i-generate-a-span-tag/113100 "2007-08-27T17:24:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mslagell](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e274bd/32.png) [@mslagell](https://www.ruby-forum.com/u/mslagell)\
**Post date:** [August 27, 2007, 5:24pm UTC](https://www.ruby-forum.com/t/how-to-i-generate-a-span-tag/113100/1 "2007-08-27T17:24:48Z")

</div>

I’m having a problem generating this HTML is my \_header.rhtml.

 ![label](https://test.ruby-forum.com/images/%0Aover.jpg)Home

I know I need to use the link\_to and image\_tag but I have not been  
able to generate the

This is the basic code

\<% if request.path\_parameters['controller'] == "home"%\>

:controller =\> ‘home’, :action =\> ‘index’  
\<% end %

---

<div class="post-metadata">

**Author:** ![mslagell](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e274bd/32.png) [@mslagell](https://www.ruby-forum.com/u/mslagell)\
**Post date:** [August 27, 2007, 5:54pm UTC](https://www.ruby-forum.com/t/how-to-i-generate-a-span-tag/113100/2 "2007-08-27T17:54:53Z")

</div>

On 8/27/07, Mark [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I’m having a problem generating this HTML is my \_header.rhtml.
> 
> ![label](https://www.ruby-forum.com/images/%0Aover.jpg)Home
> 
> I know I need to use the link\_to and image\_tag but I have not been  
> able to generate the

link\_to(image\_tag(‘image\_file\_name’), content\_tag(‘span’, ‘link  
location’))
