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

Error when trying to use an object's method to supply values to multi-value input #152

Closed
afred opened this issue May 10, 2018 · 0 comments

Comments

@afred
Copy link
Contributor

afred commented May 10, 2018

simple_form_for(foo), url: 'example.org' do |f|
  f.input :bar, as: :multi_value
end
# This will throw an error if Foo#bar exists, but bar is not an attribute on Foo.

Done when: you can create a MultiValueInput for the values from an an object's method (not just an attribute).

Our use case:

  • We have a custom input that extends MultiValueInput (similar to inputs in Hyrax).
  • We need to rearrange some of the object's terms into a different structure that is then passed to our custom input. We use an instance method to do this, but MultiValueInput currently only pays attention to attributes, not instance methods.
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