Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions lib/simple_form/inputs/autocomplete_input.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def input(wrapper_options = nil)

def input_html_options
super.deep_merge(
name: '',
name: "#{object_name}[#{attribute_name }_label]",
id: options.key?(:input_html) && options[:input_html].key?(:id) ? options[:input_html][:id] : input_tag_id,
value: options.key?(:value) ? options[:value] : input_tag_value,
data: { source: options[:source] }
Expand All @@ -41,13 +41,18 @@ def input_tag_value
elsif association.respond_to?(:name)
association.name
else
warn "#{association.class} must respond to label, title, or name"
nil
association.to_s
end
end

def hidden_tag_value
association.id if association
if association
if respond_to?(:id)
association.id
else
association.to_s
end
end
end

def sanitized_object_name
Expand Down