Amazon-like grid preview on listing pages

Hi,
I’m trying to implement an Amazon-like preview below each listing page to further stimulate user to stay on the marketplace.

But I ran into some problems. I was trying to add from the index.haml (homepage) the following snippet:

= render partial: "grid_item", collection: @listings, as: :listing, locals: { show_distance: location_search_in_use }

and adding this into the show.haml from the view/listing folder

Obviously the show_distance variable is not defined within the listing controller, but well in the homepage controller.

Is there any way to add the same grid view below within the listing pages? Is it possible to use partial render grid item and is there a way to add the locals from homepage controller to the listing controller?
If not, can you recommend any other way to go in order to achieve that?

Has anyone an idea? Ideas are highly appreciated!:wink: