Fix exception when using locale as a parameter in the url
When visiting, for example, /admin/site_customization/information_texts?locale=fr we were getting an `UncaughtThrowError: uncaught throw :exception` With the following payload ``` File "/aytomad/app/participa/participacion/releases/20180726231929/app/views/admin/site_customization/information_texts/_form_field.html.erb" line 5 File "/aytomad/app/participa/participacion/releases/20180726231929/app/helpers/globalize_helper.rb" line 35 in block in globalize ``` Substituting this line seems to solve it Note that we had to remove the portuguese local too, as it was giving a different exception due to this change. This problem, has been solved in the original globalization PR
This commit is contained in:
@@ -6,6 +6,6 @@ class I18nContent < ActiveRecord::Base
|
||||
validates :key, uniqueness: true
|
||||
|
||||
translates :value, touch: true
|
||||
globalize_accessors locales: [:en, :es, :fr, :nl, :val, :pt_br]
|
||||
globalize_accessors locales: [:en, :es, :fr, :nl, :val]
|
||||
|
||||
end
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<%= hidden_field_tag "contents[content_#{content.key}][id]", content.key %>
|
||||
<%= text_area_tag "contents[content_#{content.key}]values[value_#{locale}]",
|
||||
I18nContent.where(key: content.key).first.try(:value) ||
|
||||
I18n.backend.translate(locale, content.key),
|
||||
t(content.key, locale: locale),
|
||||
{ rows: 5,
|
||||
class: "js-globalize-attribute",
|
||||
style: display_translation?(locale),
|
||||
|
||||
Reference in New Issue
Block a user