TracksApp/tracks

View on GitHub
app/views/projects/update_status.js.rjs

Summary

Maintainability
Test Coverage
# TODO: is this dead code?
page.select('#project_status .active span').each do |element|
  element.className = @project.aasm.current_state == :active ? 'active_state' : 'inactive_state'
end
page.select('#project_status .hidden span').each do |element|
  element.className = @project.aasm.current_state == :hidden ? 'active_state' : 'inactive_state'
end
page.select('#project_status .completed span').each do |element|
  element.className = @project.aasm.current_state == :completed ? 'active_state' : 'inactive_state'
end
page.notify :notice, "Set project status to #{@project.aasm.current_state}", 5.0