# Img & link inline?

**URL:** <https://www.ruby-forum.com/t/img-link-inline/161942>\
**Category:** Rails\
**Created:** [March 4, 2009, 3:28am UTC](https://www.ruby-forum.com/t/img-link-inline/161942 "2009-03-04T03:28:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![loader](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/5daacb/32.png) [@loader](https://www.ruby-forum.com/u/loader)\
**Post date:** [March 4, 2009, 3:28am UTC](https://www.ruby-forum.com/t/img-link-inline/161942/1 "2009-03-04T03:28:36Z")

</div>

Hello everyone!

I Have a small image (icone) followed by an icone. Here is my code :  
\<%= image\_tag “/error.png” if (…) -%\>\<%= link\_to post.id,  
post\_path(post) %\>

My question is : how can I have this two things inline ?

Thank you!

---

<div class="post-metadata">

**Author:** ![loader](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/5daacb/32.png) [@loader](https://www.ruby-forum.com/u/loader)\
**Post date:** [March 4, 2009, 1:33pm UTC](https://www.ruby-forum.com/t/img-link-inline/161942/2 "2009-03-04T13:33:30Z")

</div>

I don’t know if I got your question right but I think you want something  
this:  
\<%= link\_to(image\_tag(“error.png” , :size =\> “50x22” ), :url =\>  
post\_path(post) )  
%\>
