Displaying Columns

Hello everyone,

I’m new to ROR, and need some help. I’m trying to display information in
columns.
Here is what i got so far.

<% (@post = Post.find(:all)).to_a.in_groups_of(3) do |group| %> <% group.each do |title| %> <% end %> <% end %>
<%= title %>

the title is a column value in db.

I get in return the right table div’s, but no info only hashes. It looks
like this when render:

So I know the columns are working, but how do I get it to display the
data?

I would guess group.each do |post| and then <%= post.title %> though
in_groups_of is a new one on me.

Vish

Thanks, I’ve tried that an this is the error I get:

You have a nil object when you didn’t expect it!
The error occured while evaluating nil.title

Vishnu G. wrote:

I would guess group.each do |post| and then <%= post.title %> though
in_groups_of is a new one on me.

Vish

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs