# Acts\_as\_taggable and escaping apostrophe's

**URL:** <https://www.ruby-forum.com/t/acts-as-taggable-and-escaping-apostrophes/110120>\
**Category:** Rails\
**Created:** [July 23, 2007, 3:34pm UTC](https://www.ruby-forum.com/t/acts-as-taggable-and-escaping-apostrophes/110120 "2007-07-23T15:34:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![piers](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/b3f665/32.png) [@piers](https://www.ruby-forum.com/u/piers)\
**Post date:** [July 23, 2007, 3:34pm UTC](https://www.ruby-forum.com/t/acts-as-taggable-and-escaping-apostrophes/110120/1 "2007-07-23T15:34:47Z")

</div>

Hi  
I’ve got the acts as taggable gem installed. For the main it works  
great, but when someone tags something with an apostrophe in it hangs.  
Is there an easy way round this?

An example error is:

Mysql::Error: #42000You have an error in your SQL syntax; check the  
manual that corresponds to your MySQL server version for the right  
syntax to use near ‘s’)  
AND bookmarks.id = tags\_bookmarks.bookmark\_id GROUP BY  
bookm’ at line 2: SELECT bookmarks.\* FROM tags\_bookmarks, bookmarks,  
tags WHERE tags\_bookmarks.tag\_id = tags.id  
AND (tags.name = ‘children’s’)  
AND bookmarks.id = tags\_bookmarks.bookmark\_id GROUP BY  
bookmarks.id HAVING COUNT(bookmarks.id) = 1

Thanks for any help!
