Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash when errors are on attr keys? #80

Open
timriley opened this issue Sep 27, 2018 · 0 comments
Open

Fix crash when errors are on attr keys? #80

timriley opened this issue Sep 27, 2018 · 0 comments

Comments

@timriley
Copy link
Contributor

See:

require "formalist"
require "formalist/elements/standard"

form = Class.new(Formalist::Form) do
  define do
    attr :itunes_image_attachment do
      text_field :asset_id
    end
  end
end.new

input = {"itunes_image_attachment"=>{"asset_id"=>""}}
errors = {itunes_image_attachment: ["must be filled"]}

form = form.fill(input: input, errors: errors)
# TypeError: no implicit conversion of Symbol into Integer
# from /Users/tim/Source/icelab/formalist/lib/formalist/elements/field.rb:16:in `fill'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant