%p.float-right= link_to 'New Source', new_source_path, { class: 'btn btn-primary' }

%h1 Sources

%ul
  - for source in sources
    %li= source.name

%table.table
  %thead
    %tr
      - for type in ordered_sources.keys
        %th= type.to_s.humanize
  %tbody
    - (0...Source.count).to_a.each do |position|
      %tr
        - for type in ordered_sources.keys
          - source = ordered_sources[type][position]
          %td #{source.rank_for(type)}. #{source.name}

%p.float-right= link_to 'New Source', new_source_path, { class: 'btn btn-primary' }

%h1 Sources

%table.table
  %thead
    %tr
      %th &nbsp;
      - for type in ordered_sources.keys
        %th= type.to_s.humanize
  %tbody
    - (0...Source.count).to_a.each_with_index do |position, index|
      %tr
        %td #{index + 1}
        - for type in ordered_sources.keys
          - source = ordered_sources[type][position]
          %td #{source.name}

Add column for Sources index
Add column for Sources index

By adding a column with the number, we can remove the redundant
numbers from appearing in each cell.
