This tutorial also mentions the nifty-generators gem, which just applies some basic CSS so you don't just end up with the standard black and white view. It's neat, but I'll still end up doing most of my own styling on more finished applications. (CSS is, after all, my first love)
However, I ran into a problem when trying to get rails to generate a nifty-layout. The solution was to manually add nifty-generators to the gemfile list. Easy enough!
So I ended up with three columns: name:string, description:text and finished:boolean. I've never used a boolean field before, and I did not find the standard issue true/false states satisfactory. Another google search gave me the code to edit this to a more user-friendly yes/no.
This was simply a matter of updating the view. I went from this:
<p>
<b>Finished:</b>
<%= @task.finished? %>
</p>
To this:
<p>
<b>Finished:</b>
<%= @task.finished? ? 'Yes' : 'No' %>
</p>
Aww shit, who is the dude so rad he uses a ternary operator? (Side note: I should probably brush up some more on my Ruby. But Rails is SO HOT right now!) I also updated this in the edit file, mostly for consistency.
However, I still want to be able to check or uncheck a task as "Finished," and have that change reflected in the database and displayed on the view, as well. I'm sure this is easy enough to do, but I haven't found quite what I'm looking for yet. I haven't been able to convert the old code the tutorial provides into code that makes more sense to me yet.
I also added some validation to the Tasks model. First, a task must at least have a name, right? Description should be optional, so I won't require that. How much description does "Take out the trash" really need? I also think a task is unique, so I am validating for that, as well. I also figured it makes sense for the name and description to have character limits, mostly to keep the view tidier. And here's my Task model:
class Task < ActiveRecord::Base validates_presence_of :name validates_uniqueness_of :name validates_length_of :name, :maximum=>30
validates_length_of :description, :maximum=>100
end