Created
January 18, 2012 16:45
-
-
Save manveru/1633962 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module FXC | |
class Controller < Ramaze::Controller | |
layout :main | |
engine :Etanni | |
trait js: [ | |
'/js/jquery.min.js', | |
'/js/modernizr.foundation.js', | |
'/js/jquery.reveal.js', | |
'/js/jquery.orbit-1.3.0.js', | |
'/js/forms.jquery.js', | |
'/js/jquery.customforms.js', | |
'/js/jquery.placeholder.min.js', | |
'/js/app.js', | |
] | |
private | |
def each_js_asset | |
return to_enum(__method__) unless block_given? | |
each_ancestral_trait nil do |obj, trait| | |
[*trait[:js]].each do |js| | |
yield js if js | |
end | |
end | |
end | |
def js_assets | |
each_js_asset.map{|js| | |
%(<script src="#{h js}"></script>) | |
}.join("\n") | |
end | |
end | |
end | |
require_relative 'main' | |
require_relative 'context' | |
require_relative 'super_admin' | |
require_relative 'admin' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment