I’m currently working on an online store for a sports card website using Ruby on Rails. In a sidebar on the homepage, I want to randomly generate cards from my products model (which I have already created via scaffold). How would I go about doing so? Any help would be much appreciated!
Share
Use the following as a starting point, and modify the
limitto match the number of cards you want to display.Get two random elements from a RoR model