Need help for Helper

Tomasz Tomczyk
Thu, 25 Jan 2007 20:12:48 -0000

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