Skip to content

Instantly share code, notes, and snippets.

@dpaola2
Created June 1, 2012 19:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dpaola2/2854701 to your computer and use it in GitHub Desktop.
Save dpaola2/2854701 to your computer and use it in GitHub Desktop.
<table class="table table-striped">
<thead>
<th width="80px;">Action</th>
<th>Task Details</th>
<th>Due</th>
<th>Status</th>
<th>Assignee</th>
</thead>
<% @tasks.each do |task| %>
<tr>
<td>
<% unless task.status == false %>
<%= link_to raw("<i class='icon-check'></i>"), completed_task_path(task), :method => :put, confirm: "Mark Task Complete?", class: "btn btn-success" %> <%= link_to raw("<i class='ico\
n-edit'></i>"), edit_task_path(task), class: "btn" %>
<% else %>
<center><%= link_to raw("<i class='icon-trash'></i>"), task, method: :delete, confirm: "You super sure?", class: "btn btn-danger" %></center>
<% end %>
</td>
<td>
<strong><%= task.title %></strong><br />
<%= task.description %>
</td>
<td><%= task.datetime.strftime("%b %d, %Y") %></td>
<td>
<%= if task.datetime < Date.today && task.status == true
raw("<span style='color:red;'>Overdue!</span>")
elsif task.status == true
"Active"
elsif task.status == false
raw("<span style='color:green'>Completed</span>")
end %>
</td>
<td>
<%= form_for(task) do |f| %>
<%= f.select :user_id, @users.map { |user| [user.email, user.id]}, class: "row4" %>
<% end %>
</td>
</tr>
<% end %>
</table>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment