Apply Rails/SafeNavigation rule in ERB files

This commit is contained in:
Javi Martín
2020-09-30 22:34:14 +02:00
parent 0911b89d16
commit 2eb255e85a
5 changed files with 5 additions and 5 deletions

View File

@@ -25,7 +25,7 @@
<h2 id="classification"><%= t("admin.budget_investments.show.classification") %></h2>
<p><strong><%= t("admin.budget_investments.show.assigned_admin") %>:</strong>
<%= @investment.administrator.try(:name_and_email) || t("admin.budget_investments.show.undefined") %>
<%= @investment.administrator&.name_and_email || t("admin.budget_investments.show.undefined") %>
</p>
<p id="tags">

View File

@@ -10,7 +10,7 @@
</td>
<td>
<% if valuator.valuator_group.present? %>
<%= valuator.valuator_group.try(:name) %>
<%= valuator.valuator_group&.name %>
<% else %>
<%= t("admin.valuators.index.no_group") %>
<% end %>

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).try(:location)) %>
<%= t("admin.officing_booth.title", booth: try(:current_booth)&.location) %>
</div>
<% end %>

View File

@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="<%= I18n.locale %>" data-current-user-id="<%= current_user.try(:id) %>">
<html lang="<%= I18n.locale %>" data-current-user-id="<%= current_user&.id %>">
<head>
<%= render "layouts/common_head", default_title: setting["org_name"] %>
<%= render "layouts/tracking_data" %>

View File

@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="<%= I18n.locale %>" data-current-user-id="<%= current_user.try(:id) %>">
<html lang="<%= I18n.locale %>" data-current-user-id="<%= current_user&.id %>">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />