1
0
Fork 0
mirror of https://github.com/sinatra/sinatra synced 2023-03-27 23:18:01 -04:00

layouts in dsl

This commit is contained in:
Blake Mizerany 2007-10-01 18:11:21 -07:00
parent ca5f8f35cb
commit 09f4eac1bf

View file

@ -28,4 +28,12 @@ module Kernel
end_eval
end
def layout(name = :layout, options = {})
Layouts[name] = unless block_given?
File.read("%s/%s" % [options[:views_directory] || 'views', name])
else
yield
end
end
end