Apply Rails/SafeNavigation in officing booth view

In commit 9329e4b6e, `try` was added because there was a case where this
partial was rendered and the `current_booth` method didn't exist.
However, that's no longer the case since commit d5c7858f6. Since then,
this partial is only rendered in the officing section, where the
`current_booth` method is defined.

So we can use the safe navigation operator instead of `try`.
This commit is contained in:
Javi Martín
2024-05-17 00:38:44 +02:00
parent db274e9a44
commit a15ff36a22

View File

@@ -1,5 +1,5 @@
<% if current_user.poll_officer? %>
<div id="officing-booth" class="callout info">
<%= t("admin.officing_booth.title", booth: try(:current_booth)&.location) %>
<%= t("admin.officing_booth.title", booth: current_booth&.location) %>
</div>
<% end %>