Class: Cheat::Controllers::Show

Inherits:
R
  • Object
show all
Defined in:
lib/cheat/site.rb

Instance Method Summary collapse

Instance Method Details

#get(title, version = nil) ⇒ Object



162
163
164
165
166
167
# File 'lib/cheat/site.rb', line 162

def get(title, version = nil)
  @sheet = Sheet.detect { |s| s.title == title }
  @sheet = @sheet.find_version(version) if version && @sheet

  @sheet ? render(:show) : redirect("#{URL}/b/")
end