asciinema.org/app/controllers/home_controller.rb

18 lines
424 B
Ruby
Raw Normal View History

2012-03-04 21:44:04 +00:00
class HomeController < ApplicationController
def show
if home_asciicast_id = CFG['HOME_CAST_ID']
asciicast = Asciicast.find(home_asciicast_id)
else
asciicast = Asciicast.order("created_at DESC").first
end
2012-07-25 18:24:20 +00:00
if asciicast
@asciicast = AsciicastDecorator.new(asciicast)
end
@asciicasts = AsciicastDecorator.decorate(
Asciicast.order("created_at DESC").limit(9)
)
2012-03-04 21:44:04 +00:00
end
end