Class: Ella::Controller

Inherits:
Sinatra::Base
  • Object
show all
Defined in:
lib/ella/controller.rb

Overview

Sinatra was not specifically designed to have different modular controller files. Some of the magic needs to go here, and maintaining a specific loading order is important: seemingly insignificant changes can break the little hacks that allow Sinatra to be used as a macro-framework.

Instance Method Summary collapse

Instance Method Details

#css_pathObject



28
29
30
31
# File 'lib/ella/controller.rb', line 28

def css_path
  filename = Dir.glob("public/css/*").max_by {|f| File.mtime(f)}
  filename.sub('public', '')
end

#js_pathObject

TODO: Some fancy-pants metaprogramming to allow for all user-defined pipelines.



23
24
25
26
# File 'lib/ella/controller.rb', line 23

def js_path
  filename = Dir.glob("public/js/*").max_by {|f| File.mtime(f)}
  filename.sub('public', '')
end