Skip to content
This repository was archived by the owner on May 5, 2020. It is now read-only.

Support for attribute names as a string #68

Open
lostie opened this issue Nov 18, 2016 · 0 comments · May be fixed by #69
Open

Support for attribute names as a string #68

lostie opened this issue Nov 18, 2016 · 0 comments · May be fixed by #69
Labels

Comments

@lostie
Copy link

lostie commented Nov 18, 2016

When trying to define a html tag for an attribute which is specified as a string, e.g.:

builder.text_area 'my_form_field'

The following error occurs:

     Failure/Error: output = builder.send method, 'name'
     NoMethodError:
       undefined method `find' for "name":String
     Shared Example Group: "input field" called from ./spec/lib/govuk_elements_form_builder/form_builder_spec.rb:272
     # ./lib/govuk_elements_form_builder/form_builder.rb:197:in `form_group_classes'
     # ./lib/govuk_elements_form_builder/form_builder.rb:29:in `block (2 levels) in <class:FormBuilder>'
     # ./spec/lib/govuk_elements_form_builder/form_builder_spec.rb:39:in `block (3 levels) in <top (required)>'

This is raised here as a ruby String also responds to the method :count and the conversion to array is not done appropriately.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant