asciinema.org/app/controllers/home_controller.rb

11 lines
377 B
Ruby
Raw Normal View History

2012-03-04 21:44:04 +00:00
class HomeController < ApplicationController
def show
2012-03-11 14:29:31 +00:00
offset = (Asciicast.featured.count * rand).to_i
2012-04-07 09:13:43 +00:00
asciicast = Asciicast.featured.offset(offset).first ||
Asciicast.order("created_at DESC").first
@asciicast = AsciicastDecorator.new(asciicast)
2012-07-25 18:24:20 +00:00
@asciicasts = AsciicastDecorator.decorate(Asciicast.order("created_at DESC").limit(9))
2012-03-04 21:44:04 +00:00
end
end