# Output String while expecting hash

**URL:** <https://www.ruby-forum.com/t/output-string-while-expecting-hash/184637>\
**Category:** Rails\
**Created:** [March 5, 2010, 4:39pm UTC](https://www.ruby-forum.com/t/output-string-while-expecting-hash/184637 "2010-03-05T16:39:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![prashanth](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/439d5e/32.png) [@prashanth](https://www.ruby-forum.com/u/prashanth)\
**Post date:** [March 5, 2010, 4:39pm UTC](https://www.ruby-forum.com/t/output-string-while-expecting-hash/184637/1 "2010-03-05T16:39:02Z")

</div>

Hi  
I have been trying to fetch the output as an  
hash but it is returning string.I am storing the data

in the following format.

* * *

:input\_type:

- text\_field

- ride\_from

🏷 Ride From

:input\_type:

- text\_field

- ride\_from

🏷 Ride From

- :input\_type:

option\>Once WeeklyFrequently

🏷 Trip Frequency

I am trying to use “send” to convert to html tags like :

```
          <removed_email_address@domain.invalid_field.each do |form_field| -%>
         <div class="registration-user-fields">
            <div class="registration-field-text">
               <%=form_field[:label]-%>:
            </div>
            <div class="registration-field-value">
             <%=send(form_field[:input_type][0],

```

“attributes[#{form\_field[:input\_type][1]}]”, form\_field[:input\_type]  
[2],:class=\>“reg-input-box”)-%\>

In the model i have specified serialize the table field name  
“form\_field”

it is working well in other table but returning as string in this  
table help please.

Regards  
Prashanth

---

<div class="post-metadata">

**Author:** ![prashanth](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/439d5e/32.png) [@prashanth](https://www.ruby-forum.com/u/prashanth)\
**Post date:** [March 5, 2010, 5:04pm UTC](https://www.ruby-forum.com/t/output-string-while-expecting-hash/184637/2 "2010-03-05T17:04:14Z")

</div>

On Mar 5, 3:37 pm, Prashanth [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> In the model i have specified serialize the table field name  
> “form\_field”
> 
> it is working well in other table but returning as string in this  
> table help please.

If your data is getting truncated because the column is too small then  
you’ll get back a yaml string rather than the unserialized object.

Fred
