CDRH / orchid

Rails Engine for site integration with CDRH API
MIT License
3 stars 0 forks source link

route_path helper not available to overrides #290

Open techgique opened 1 year ago

techgique commented 1 year ago

Will and Erin have both recently worked on overrides for search interface partials and run into a problem with the code copied from Orchid causing undefined local variable or method route_path errors. An example of this is trying to override the search box partial.

In this template, prefix_path's argument is route_path. Within the Orchid Rails engine context, this is calling a helper method: https://github.com/CDRH/orchid/blob/v3.1.1/app/helpers/orchid/application_helper.rb#L308 But this helper method isn't available when overridden from the main Rails app.

We've gotten around this by replacing route_path with just passing the default string value that the method returns "search_path" but this is confusing when creating overrides and would break use of the @route_path value it can return as well. Want to figure out how to make Orchid's helpers like this available to the main app as well.