# Newb: convert contents of sql text field to an array or hash

**URL:** <https://www.ruby-forum.com/t/newb-convert-contents-of-sql-text-field-to-an-array-or-hash/87133>\
**Category:** Rails\
**Created:** [March 25, 2006, 6:29pm UTC](https://www.ruby-forum.com/t/newb-convert-contents-of-sql-text-field-to-an-array-or-hash/87133 "2006-03-25T18:29:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![woodie63](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/cc9497/32.png) [@woodie63](https://www.ruby-forum.com/u/woodie63)\
**Post date:** [March 25, 2006, 6:29pm UTC](https://www.ruby-forum.com/t/newb-convert-contents-of-sql-text-field-to-an-array-or-hash/87133/1 "2006-03-25T18:29:30Z")

</div>

Hi I have a text field in my sql called: keywords  
in it are various keywords (suprise!) ‘keywords\_1_keyword\_2_keyword\_3’  
etc.  
all keyword phrases take\_this\_format seperated by an asterisk\*

In my rails app I would like to populate checkboxes with my keywords to  
show that they are already chosen.

can someone please point me in the right direction?  
cheers

Peter
