You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Hotwire / Turbo relies on unique dom ids. Rails has a dom_id helper method which simplifies getting a dom id for a given ActiveRecord object.
When the load: option is true, Searchkick instantiates the actual AR objects so the dom_id helper works with a result object
But when the load: option is false, the search results are not the underlying AR object, therefore do not respond to param_key and can't be used with the dom_id helper.
Describe the solution you'd like
To be able to use the Searchkick results in a modern rails app but still be able to use the indexed data only without load: true, I would like to be able to have a Searchkick result object be compatible with the dom_id helper method. If this means adding more fields and a class name, etc. to the Searchkick index, that'd be fine.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Hotwire / Turbo relies on unique dom ids. Rails has a
dom_id
helper method which simplifies getting a dom id for a given ActiveRecord object.When the
load:
option istrue
, Searchkick instantiates the actual AR objects so thedom_id
helper works with a result objectBut when the
load:
option isfalse
, the search results are not the underlying AR object, therefore do not respond toparam_key
and can't be used with thedom_id
helper.Describe the solution you'd like
To be able to use the Searchkick results in a modern rails app but still be able to use the indexed data only without
load: true
, I would like to be able to have a Searchkick result object be compatible with thedom_id
helper method. If this means adding more fields and a class name, etc. to the Searchkick index, that'd be fine.The text was updated successfully, but these errors were encountered: