From a23ee3b2a80e8021d5ad11e27eacdc1f84bc1b38 Mon Sep 17 00:00:00 2001 From: David Singleton Date: Tue, 16 Jun 2015 12:04:10 +0000 Subject: [PATCH] Use symbols, not strings, for component object keys We should only use one style of keys for objects used in components, to avoid reduce confusion when using components. Consistency is good. After discussion with @edds we agreed to use symbols as this makes more sense in a ruby/rails environment. The first step was to support both, as clients of those components will still be sending string key'd objects and can't be updated at the time as this app, so we have to; 1. Support both kinds of keys on components that expect strings 2. Update clients sending string keys to use symbols instead 3. Remove support for string keys from those components This PR is step 2. for `previous_and_next_navigation`, but also needs doing in `finder-frontend` for `options_select`. Step 1 is: https://github.com/alphagov/static/pull/601 --- app/helpers/application_helper.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 24b155f6..dbf68c29 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -16,8 +16,8 @@ def previous_and_next_links(document) if document.previous_sibling siblings.merge!( previous_page: { - "title" => "Previous page", - "url" => document.previous_sibling.base_path + title: "Previous page", + url: document.previous_sibling.base_path } ) end @@ -25,8 +25,8 @@ def previous_and_next_links(document) if document.next_sibling siblings.merge!( next_page: { - "title" => "Next page", - "url" => document.next_sibling.base_path + title: "Next page", + url: document.next_sibling.base_path } ) end