This is my statement to retrieve data
@week_activities = Activity.where(:weeknum => 1)
This is how I am displaying it
<%= @week_activities.each do |d| %>
<%= d.id %>, <%= d.week %>, <%= d.day %> <br/>
<% end %>
It’s displaying what I want they way I want it
1, 1, Monday
2, 1, Tuesday
3, 1, Wednesday
4, 1, Thurday
5, 1, Friday
6, 1, Saturday
7, 1, Sunday
Then for a reason I ignore, it displays the whole table as a array
[#<Activity id: 1, jog: 0, pushups: 0, situps: 0, bicycl: 0, squats: 0,
lunges: 0, foodid: 0, ccalor: 0, bcalor: 0, user_id: nil,
created_at: "2012-11-23 03:12:54", updated_at: "2012-11-23 03:12:54", week: 1,
day: "Monday"> ... and so on.
Is there any reason, it displaying the content of the whole table?
You’re using an
=where you shouldn’t.