ministryofjustice / govuk_elements_form_builder

Form builder helper methods to develop GOV.UK elements styled applications in Ruby on Rails
https://govuk-elements-rails-guide.herokuapp.com/
MIT License
6 stars 14 forks source link

Support for namespaced resources when generating error anchors. #87

Closed zheileman closed 7 years ago

zheileman commented 7 years ago

We've faced this issue where using namespaced resources/models will generate incorrect anchor tags in the error summary, due to the '::' being left as '/' instead of the expect '_' to match the ID of the form element producing the error.

Basically, the code generating the form element error ID is different to the code generating the error summary anchor link, and thus this situation.

A better solution would be to make sure the exact same code is used in both places, but due to the different contexts (form builder and helper) this is also not ideal.