fablabbcn/fablabs

View on GitHub
app/views/employees/_employee.html.haml

Summary

Maintainability
Test Coverage
= content_tag_for :div, employee, class: 'media' do
  .float-left
    = image_tag employee.user.avatar_url, class: 'avatar med'
  .media-body
    = link_to employee.user, employee.user
    .job-title= employee.job_title
    .description= employee.description
    = employee.current_state

    = link_to "Edit", edit_employee_path(employee), class: 'button tiny'
    = link_to "Remove", employee, method: :delete, class: 'button tiny alert'

    - employee.current_state.events.keys.each do |event|
      = button_to event.capitalize, {controller: 'employees', action: event, id: employee.id }, method: :patch, class: 'button tiny'