2012-03-04 21:44:04 +00:00
|
|
|
class HomeController < ApplicationController
|
|
|
|
def show
|
2012-07-25 20:59:18 +00:00
|
|
|
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
|
|
|
|
2012-07-25 20:59:18 +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
|