Locales helper improvement

Added a rescue block in `name_for_locale()` to ensure the application doesn't crash in case it receives an invalid locale.
This commit is contained in:
María Checa
2017-07-03 12:55:22 +02:00
parent da2b55942a
commit 3e2cbabc9c
2 changed files with 4 additions and 2 deletions

View File

@@ -28,7 +28,7 @@
<td><%= I18n.l page.created_at, format: :short %></td>
<td><%= I18n.l page.created_at, format: :short %></td>
<td><%= t("admin.site_customization.pages.page.status_#{page.status}") %></td>
<td><%= name_for_locale(page.locale) rescue nil %></td>
<td><%= name_for_locale(page.locale) %></td>
<td class="small">
<span class="icon-eye"></span>
<% if page.status == "published" %>