Rails 显示随机图片

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

class HelloController < ApplicationController
  def show
     @images  = ["image1.jpg", "image2.jpg", "image3.jpg", "image4.jpg", "image5.jpg"]
     @random_no = rand(5)
     @random_image = @images[@random_no]
  end
end