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

Values in autocomplete field are not saved #4

Open
nabeta opened this issue Nov 7, 2018 · 0 comments
Open

Values in autocomplete field are not saved #4

nabeta opened this issue Nov 7, 2018 · 0 comments

Comments

@nabeta
Copy link

nabeta commented Nov 7, 2018

I'm trying to enable autocomplete in a creator field on my berlin2018 VM.
https://github.com/samvera/hyrax/wiki/Autocomplete-in-Hyrax

I created app/views/records/edit_fields/_creator.html.erb as the following.

<% name_authorities = Hyrax::NameAuthorities.new %>

<%=
  f.input key,
  as: :multi_value,
  input_html: {
    class: 'form-control',
    data: { 'autocomplete-url' => "/authorities/search/loc/names",
      'autocomplete' => key }
  } ,
  required: f.object.required?(key) %>

<!-- comment out this line to make this form work properly?? -->
<%= f.input key, collection: name_authorities.select_active_options, label: false %>

Autocomplete works as I expected. The problem is that the value I entered into the creator field is not saved if the last line of this template exists. When I commented out the line, the values were saved successfully. Is it a bug, or am I missing something else?

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