todo controller

Subscribe to todo controller 4 post(s), 3 voice(s)

 
Avatar Bharat Parmar 3 post(s)

Hello,

I am newbie in RoR. I am getting following error from index.html.erb. Can anybody help me out ?

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

Extracted source (around line #14):

11: :controller => “task”,
12: :action => “mark_complete”,
13: :id => todo.id >
14: <
if todo.task.complete >
15: <strike><
= todo.task.name ></strike>
16: < else >
17: <
= todo.name %>

 
Avatar stranger 46 post(s)

hey bharat could you see the development.log in the log folder and check for the error. If you see any error just zip the whole application and upload in any file hosting. We will check and let you know the problem…

 
Avatar EldonAlameda Administrator 196 post(s)

Bharat,

Did you apply the errata notes from http://railsprojects.com/forums/3/topics/17 to your application.

The Task model was incorrect in the book (for some reason an older version of the model got printed), which might cause orphaned data in your database if you deleted a task that was already in the current todo list.

 
Avatar Bharat Parmar 3 post(s)

Hey thanks

I got it solved.