How to print out a random number between a range? [duplicate] June 5, 2023 by Tarik Give this a shot. <%= [*5..30].sample %> …or… <%= rand(5..30) %>