Fix keyword arguments in action components calls

We were passing a hash of options instead of converting them to keyword
parameters, which resulted in warnings on Ruby 2.7:

```
app/components/admin/table_actions_component.html.erb:5: warning: Using
the last argument as keyword parameters is deprecated; maybe ** should
be added to the call

app/components/admin/table_actions_component.html.erb:9: warning: Using
the last argument as keyword parameters is deprecated; maybe ** should
be added to the call

app/components/admin/widget/cards/row_component.html.erb:20: warning:
Using the last argument as keyword parameters is deprecated; maybe **
should be added to the call

app/components/admin/widget/cards/table_component.html.erb:14: warning:
Using the last argument as keyword parameters is deprecated; maybe **
should be added to the call
```
This commit is contained in:
Javi Martín
2021-09-19 16:22:53 +02:00
parent a75a2894ce
commit dffe7966f6
3 changed files with 4 additions and 4 deletions

View File

@@ -2,10 +2,10 @@
<%= content %> <%= content %>
<% if actions.include?(:edit) %> <% if actions.include?(:edit) %>
<%= action(:edit, edit_options.merge(text: edit_text, path: edit_path)) %> <%= action(:edit, **edit_options.merge(text: edit_text, path: edit_path)) %>
<% end %> <% end %>
<% if actions.include?(:destroy) %> <% if actions.include?(:destroy) %>
<%= action(:destroy, destroy_options.merge(text: destroy_text, path: destroy_path)) %> <%= action(:destroy, **destroy_options.merge(text: destroy_text, path: destroy_path)) %>
<% end %> <% end %>
</div> </div>

View File

@@ -17,6 +17,6 @@
<% end %> <% end %>
</td> </td>
<td> <td>
<%= render Admin::TableActionsComponent.new(card, options) %> <%= render Admin::TableActionsComponent.new(card, **options) %>
</td> </td>
</tr> </tr>

View File

@@ -11,7 +11,7 @@
</thead> </thead>
<tbody> <tbody>
<% cards.each do |card| %> <% cards.each do |card| %>
<%= render Admin::Widget::Cards::RowComponent.new(card, options) %> <%= render Admin::Widget::Cards::RowComponent.new(card, **options) %>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>