Sitepoint demo app for learning to use Sinatra
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

11 lines
541 B

  1. %li[task]{ class: (task.completed_at.nil? ? "" : "completed") }
  2. = task.name
  3. %form.update(action="/task/#{task.id}" method="POST")
  4. %input{ type: 'hidden', name: '_method', value: 'PUT' }
  5. -if task.completed_at.nil?
  6. %input{type: 'submit', value: '−', title: 'Complete Task'}
  7. -else
  8. %input{type: 'submit', value: '✓', title: 'Uncomplete Task'}
  9. %form.delete(action="/task/#{task.id}" method="POST")
  10. %input(type="hidden" name="_method" value="DELETE")
  11. %input(type="submit" value="✗" title="Delete Task")