Skip to content

Instantly share code, notes, and snippets.

@joshskeen
Created July 9, 2012 17:45
Show Gist options
  • Save joshskeen/3077841 to your computer and use it in GitHub Desktop.
Save joshskeen/3077841 to your computer and use it in GitHub Desktop.
%div.row
%div.span5
%h2 todo list:
- unless @items.empty?
%div
%table.table-striped.table-condensed.table-bordered{:style => "width:470"}
%tr
%th name
%th description
%th actions
-for item in @items do
%tr{:class => item.complete == true ? 'completed' : 'incomplete'}
%td=item.name
%td=item.description
%td
=(link_to item.complete == false ? 'complete' : 'reopen', {:action => "complete",:id => item.id, :controller => :items}, :class => "btn")
=(link_to 'delete', item, :data => {:confirm => "are you sure you want to delete \"#{item.name}\""},:method => :delete, :class => "btn")
-else
p
| no todo items found!
-unless @errors.nil?
%div.label.label-important=@errors
%h3 new todo item:
= render :partial => 'items/haml/form'
%div.span7
%h4 index.haml
%h4 form.haml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment