In my @products
table displayed on index.html.erb
, clicking on any product triggers an AJAX request to load the _show.html.erb
partial. However, I'm wondering if there's a way to automatically have the first product load on the page without requiring a click for the AJAX request.
Currently, when the initial page loads, the area where the partial should render remains blank until a product is clicked. I want the first product to be loaded upon opening index.html.erb
.