# Helper help

**URL:** <https://www.ruby-forum.com/t/helper-help/83393>\
**Category:** Ruby\
**Created:** [January 25, 2007, 6:56pm UTC](https://www.ruby-forum.com/t/helper-help/83393 "2007-01-25T18:56:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tomasz\_Tomczyk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/b487fb/32.png) [@Tomasz\_Tomczyk](https://www.ruby-forum.com/u/Tomasz_Tomczyk)\
**Post date:** [January 25, 2007, 6:56pm UTC](https://www.ruby-forum.com/t/helper-help/83393/1 "2007-01-25T18:56:30Z")

</div>

I need a helper, which will render a table in my customized style.  
I wrote a code like this:

template.rhtml:  
\<% @column\_names = [“Name”, “Age”, “Sex”] %\>  
\<%= table\_show @column\_name %\>

helper.rb  
def table\_show(names)  
for name in names  
content\_tag ( :div, name, :class =\> ‘table\_header’ )  
end  
end

Which should give me an output like this:

Name

Age

Sex

Unfortunately I have only one line of output which looks like:  
NameAgeSex

After few trials it seems, that this output is being generated by line:  
“for name in names”, because deleting “content\_tag…” doesn’t make any  
differences.

What am I doing wrong?  
I suppose that helper def does treat an Array like a String…

Regards,  
Tomasz Tomczyk

---

<div class="post-metadata">

**Author:** ![Tomasz\_Tomczyk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/b487fb/32.png) [@Tomasz\_Tomczyk](https://www.ruby-forum.com/u/Tomasz_Tomczyk)\
**Post date:** [January 25, 2007, 7:46pm UTC](https://www.ruby-forum.com/t/helper-help/83393/2 "2007-01-25T19:46:40Z")

</div>

On Jan 25, 10:52 am, “Tomasz Tomczyk” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I need a helper, which will render a table in my customized style.  
> [snip]

You will probably get a better response if you ask this on the Ruby on  
Rails mailing list. The Ruby-talk mailing list (and forum, and  
comp.lang.ruby newsgroup) is primarily for discussion of the Ruby  
language itself, not the Ruby on Rails web framework that happens to  
use it.

[http://groups.google.com/group/rubyonrails-talk](http://groups.google.com/group/rubyonrails-talk)
