I'm very new to Ruby and Rails so someone please help me with this..
I'm creating basically a To Do list app, and on my table I have a "Done" column. When I generated the scaffold in rails, I made the column like "done:boolean". So now when you create or edit a task it has a checkbox that you can either check or uncheck for "Done". So on the page where it displays the whole list of tasks, in the "Done" column it states either "True" if it was checked, or "False" if it was unchecked. So my question is, How do I replace that "True" or "False" with a Checked Box or an Unchecked box? Also I would like it to grey out the row when "True". Thanks in advance!
Here's some of my code that I tried:
Index.html.erb:
`
<h1 id="title">Project List</h1>
<table>
<thead>
<tr id="headers">
<th>Title</th>
<th>Client</th>
<th>Description</th>
<th>Hours</th>
<th>Done</th>
<th colspan="3"></th>
</tr>
</thead>
<tbody class="col-md-2" id="listItems">
<% @projects.each do |project| %>
<tr id="table">
<td><%= project.title %></td>
<td><%= project.client %></td>
<td ><%= project.description %></td>
<td><%= project.hours %></td>
<td><%= check_box_tag "project_#{project.id}", "#{project.done}", "#{project.done? ? 'true':'false'", "#{project.done? ? 'true':'false'" %>
</td>
<td>
<span title="Show">
<%= link_to " #{image_tag('show.png')}".html_safe, project, id:'showButton' %>
</span>
</td>
<td>
<span title="Edit">
<%= link_to " #{image_tag('edit.png')}".html_safe, edit_project_path(project), id:'editButton' %>
</span>
</td>
<td>
<span title="Delete">
<%= link_to " #{image_tag('destroy.png')}".html_safe, project, id:'destroyButton', method: :delete, data: { confirm: 'Are you sure?' } %>
</span>
</td>
</tr>
<% end %>
</tbody>
</table>
<br>
<%= link_to 'New Project', new_project_path, id:"new" %>
`