# String concatenation with symbol

**URL:** <https://www.ruby-forum.com/t/string-concatenation-with-symbol/115637>\
**Category:** Rails\
**Created:** [September 27, 2007, 3:46am UTC](https://www.ruby-forum.com/t/string-concatenation-with-symbol/115637 "2007-09-27T03:46:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fede](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/9fc348/32.png) [@fede](https://www.ruby-forum.com/u/fede)\
**Post date:** [September 27, 2007, 3:46am UTC](https://www.ruby-forum.com/t/string-concatenation-with-symbol/115637/1 "2007-09-27T03:46:35Z")

</div>

I’m trying to make this work:  
@targets = Targets.find(:all, :conditions =\> 'description LIKE :id ')  
I know it can’t work having the :id in there just like that but I  
can’t find a way to embed that in there. Thanks in advance guys!

---

<div class="post-metadata">

**Author:** ![fede](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/9fc348/32.png) [@fede](https://www.ruby-forum.com/u/fede)\
**Post date:** [September 27, 2007, 4:22am UTC](https://www.ruby-forum.com/t/string-concatenation-with-symbol/115637/2 "2007-09-27T04:22:25Z")

</div>

fede wrote:

> I’m trying to make this work:  
> @targets = Targets.find(:all, :conditions =\> 'description LIKE :id ')  
> I know it can’t work having the :id in there just like that but I  
> can’t find a way to embed that in there. Thanks in advance guys!

I am not sure exactly what you are trying to accomplish, but maybe this  
form of #find will help you out:

@targets = Targest.find(:all, :conditions =\> [‘description LIKE ?’,  
whatever])

David B. Williams  
[http://www.cybersprocket.com](http://www.cybersprocket.com)
