lfzawacki/musical-artifacts

View on GitHub
app/views/artifacts/_artifact_tags.html.haml

Summary

Maintainability
Test Coverage
- # TODO: Hash ordering is not guaranteed, but I don't want to write extra code here
- # If this breaks it's just an aesthetic bug and then I can deal with it
- lists = {'app' => :software, 'tag' => :tag, 'format' => :file_format }

- lists.each do |tag_name, list_name|

  - list = artifact.send("#{list_name}_list")

  - if list.present?
    - list.each do |tag|
      .label{class: "label-#{tag_name}"}
        = link_to tag, artifacts_path(tag_name.pluralize => tag)
    %br