Skip to content

Commit

Permalink
Autocomplete: Use URL helper instead of absolute_url_for
Browse files Browse the repository at this point in the history
This uses Rails's standard URL helper instead of the custom one in the
app to establish the absolute URL for the autocomplete endpoint.
  • Loading branch information
csutter committed Nov 14, 2024
1 parent b328fec commit 55c7ccd
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions app/controllers/finders_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ def show_page_variables
@pagination = pagination_presenter
@spelling_suggestion_presenter = spelling_suggestion_presenter
@ab_test_search_component = use_autocomplete? ? "search_with_autocomplete" : "search"
@autocomplete_source_url = ENV.fetch(
"SEARCH_AUTOCOMPLETE_API_URL",
helpers.absolute_url_for(api_search_autocomplete_path(format: :json)),
)
end

private
Expand Down
2 changes: 1 addition & 1 deletion app/views/finders/show_all_content_finder.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
wrap_label_in_a_heading: true,
heading_level: 1,
margin_bottom: 0,
source_url: @autocomplete_source_url,
source_url: api_search_autocomplete_url(format: :json),
source_key: "suggestions"
} %>
</div>
Expand Down

0 comments on commit 55c7ccd

Please sign in to comment.