mlopke
1
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| %>
<%= title %> |
<% end %>
<% end %>
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?
mlopke
2
I would guess group.each do |post| and then <%= post.title %> though
in_groups_of is a new one on me.
Vish
mlopke
3
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