Skip to content

Values in autocomplete field are not saved #4

@nabeta

Description

@nabeta

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions