diff options
author | Gareth Rees <gareth@mysociety.org> | 2015-01-22 15:05:11 +0000 |
---|---|---|
committer | Gareth Rees <gareth@mysociety.org> | 2015-02-03 16:24:01 +0000 |
commit | 40dd8b05787e665d3d5534acfb6208e236240698 (patch) | |
tree | e54abc92d8ca93312cb4e30f79d93fdb67efecc6 /app/helpers | |
parent | 7c7b008a0f2c6937b6bf02ab26134bb90aae19ee (diff) |
Build available locales in the controller
Removes logic from views and obsoletes
AdminPublicBodyHelper#public_body_form_object
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/admin_public_body_helper.rb | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/app/helpers/admin_public_body_helper.rb b/app/helpers/admin_public_body_helper.rb deleted file mode 100644 index 97f656ddb..000000000 --- a/app/helpers/admin_public_body_helper.rb +++ /dev/null @@ -1,22 +0,0 @@ -module AdminPublicBodyHelper - - def public_body_form_object(public_body, locale) - if locale == I18n.default_locale - # The default locale is submitted as part of the bigger object... - prefix = 'public_body' - object = public_body - else - # ...but additional locales go "on the side" - prefix = :translations - object = if public_body.new_record? - PublicBody::Translation.new - else - public_body.find_translation_by_locale(locale.to_s) - end - object ||= PublicBody::Translation.new - end - - { :object => object, :prefix => prefix } - end - -end |