asciinema.org/app/controllers/home_controller.rb

26 lines
545 B
Ruby
Raw Normal View History

2012-03-04 21:44:04 +00:00
class HomeController < ApplicationController
before_filter :load_asciicast
2012-03-04 21:44:04 +00:00
def show
2012-08-02 07:21:23 +00:00
@title = "Share Your Terminal With No Fuss"
if @asciicast
@asciicast = AsciicastDecorator.new(@asciicast)
end
2013-05-27 19:23:46 +00:00
@asciicasts = AsciicastDecorator.decorate_collection(
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
private
def load_asciicast
if id = CFG['HOME_CAST_ID']
@asciicast = Asciicast.find(id)
else
@asciicast = Asciicast.order("created_at DESC").first
end
end
2012-03-04 21:44:04 +00:00
end