asciinema.org/app/controllers/home_controller.rb

20 lines
489 B
Ruby
Raw Normal View History

2012-03-04 21:44:04 +00:00
class HomeController < ApplicationController
def show
2012-08-02 07:21:23 +00:00
@title = "Share Your Terminal With No Fuss"
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(
2012-08-21 18:25:50 +00:00
Asciicast.order("created_at DESC").limit(9).includes(:user)
)
2012-03-04 21:44:04 +00:00
end
end