Hi all,
Im trying to get my head around rails and to help along Im working
through “four days on rails” as this seems to give a good real world
example with multiple tables and relationships (the main thing I cant
work out!)
Ive got stuck. Some help would be really good here.
The controller has this code:
def list
@category_pages, @categories = paginate(:category, :per_page => 10,
:order_by -> ‘category’)
end
and the view has this (just the bit thats causing the issue not all of
it)
<% for category in @categories %>
But its throwing the error nil object when you didn’t expect it!
The error occured while ecaluating nil.strftime
Can someone point out the problem here? I think its right, and I guess
categories is passed through with the right stuff in it, the db has the
field defined, with the following data in it:
±—±---------±--------------------±--------------------+
| id | category | create_on | updated_on |
±—±---------±--------------------±--------------------+
| 1 | test | 2006-06-13 18:33:00 | 2006-06-13 18:33:47 |
| 2 | another | 2006-06-13 18:33:00 | 2006-06-13 18:33:52 |
| 3 | better | 2006-06-13 18:34:00 | 2006-06-13 18:34:43 |
±—±---------±--------------------±--------------------+
Any help would be appreciated.
Also any pointers to tutorials that can help me get my head around this
would also be appreciated.
Regards
Jonathan