From 0593bf68940a171a82409bf1194cb6b4bb914df1 Mon Sep 17 00:00:00 2001 From: David Singleton Date: Tue, 16 Jun 2015 11:15:46 +0000 Subject: [PATCH] Support symbol and string keys for some components This is a transitional change to switch components that expect string key'd objects to handle symbol key'd objects only. We should only use one style of keys for objects used in components, to avoid reduce confusion when using components (I spent a while trying to work out why the arguements I was passing to prev/next weren't rendering). Consistency is good. After discussion with @edds we agreed to use symbols consistently, as this makes more sense in a ruby/rails environment. The first step is 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 these components This PR is step 1., and using `with_indifferent_access` is a quick hack to support both, which we can remove at step 3. --- .../govuk_component/option_select.raw.html.erb | 12 ++++++------ .../previous_and_next_navigation.raw.html.erb | 14 ++++++++------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/app/views/govuk_component/option_select.raw.html.erb b/app/views/govuk_component/option_select.raw.html.erb index e667d266b..99388961c 100644 --- a/app/views/govuk_component/option_select.raw.html.erb +++ b/app/views/govuk_component/option_select.raw.html.erb @@ -5,24 +5,24 @@
<% options.each do | option |%> - -
diff --git a/app/views/govuk_component/previous_and_next_navigation.raw.html.erb b/app/views/govuk_component/previous_and_next_navigation.raw.html.erb index 048f3058b..ba7afb31f 100644 --- a/app/views/govuk_component/previous_and_next_navigation.raw.html.erb +++ b/app/views/govuk_component/previous_and_next_navigation.raw.html.erb @@ -1,18 +1,20 @@