Skip to content

Commit

Permalink
Change ac arg to hidden_value
Browse files Browse the repository at this point in the history
  • Loading branch information
nimmolo committed Aug 4, 2024
1 parent adc0b0d commit 1e99bd3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/helpers/forms_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def autocompleter_field(**args)
placeholder: :start_typing.l, autocomplete: "off",
data: { autocompleter_target: "input" }
}.deep_merge(args.except(:type, :separator, :textarea,
:hidden, :hidden_data, :create_text,
:hidden_value, :hidden_data, :create_text,
:keep_text, :edit_text, :find_text))
ac_args[:class] = class_names("dropdown", args[:class])
ac_args[:wrap_data] = { controller: :autocompleter, type: args[:type],
Expand Down Expand Up @@ -298,7 +298,7 @@ def autocompleter_hidden_field(**args)

model = autocompleter_type_to_model(args[:type])
data = { autocompleter_target: "hidden" }.merge(args[:hidden_data] || {})
args[:form].hidden_field(:"#{model}_id", value: args[:hidden], data:)
args[:form].hidden_field(:"#{model}_id", value: args[:hidden_value], data:)
end

def autocompleter_type_to_model(type)
Expand Down
2 changes: 1 addition & 1 deletion app/views/controllers/observations/form/_details.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ t_s = {
tag.span("#{:form_observations_create_locality.l}:",
class: "create-label")].safe_join(" "),
help: observation_location_help,
hidden: location&.id,
hidden_value: location&.id,
hidden_data: { map_target: "locationId",
north: location&.north, south: location&.south,
east: location&.east, west: location&.west },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<% fields_for(:herbarium_record) do |fhr| %>
<%= autocompleter_field(
form: fhr, field: :herbarium_name, type: :herbarium,
value: @herbarium_name, hidden: @herbarium_id,
value: @herbarium_name, hidden_value: @herbarium_id,
label: "#{:herbarium_record_herbarium_name.t}:",
help: :form_observations_herbarium_record_help.t
) %>
Expand Down

0 comments on commit 1e99bd3

Please sign in to comment.