Cfaf074970ce958900608fceaac38543

Is there a way in Ruby to pass multiple values into my block? I'm looking to set the values of 'asset', 'usage' and 'request' a single time instead of constantly "drilling down" through the usage variable.

1
2
3
4
5
6
7
8
9
10
11
12
13
<% @purchase_order.grants.each do |grant| %>
  <table>  
    <tbody>
      <tr>
        <td><%= grant.usage.asset.identifier %></td>
        <td><%= grant.usage.asset.credit %></td>
        <td><%= grant.usage.size.name %></td>
        <td><%= grant.usage.placement.name %></td>
        <td><%= Request::RequestType.from_value grant.usage.request.request_type %></td>
      </tr>
    </tbody>
  </table>  
<% end %>

Refactorings

No refactoring yet !

Your refactoring





Format Copy from initial code

or Cancel