Skip to content

Instantly share code, notes, and snippets.

@lorawoodford
Created May 5, 2020 18:25
Show Gist options
  • Save lorawoodford/f24c33f23667ab7fa363e0d711a4d6f4 to your computer and use it in GitHub Desktop.
Save lorawoodford/f24c33f23667ab7fa363e0d711a4d6f4 to your computer and use it in GitHub Desktop.
jobs_index refactor
<ul style="padding-left: 20px;">
<% (record['job_data'] || []).each_with_index do |data, i| %>
<li>
<% if (record['files'] || [])[i] %>
<% type, filename = data.split(' --- ', 2) %>
<%= type %>: <a href="<%= AppConfig[:frontend_proxy_url] + record['files'][i] %>"><%= filename %></a>
<% else %>
<% data = data.split(': ', 2) %>
<%= "#{I18n.t(data[0])}: #{data[1]}" %>
<% end %>
</li>
<% end %>
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment