Skip to content

Commit

Permalink
layouts in dsl
Browse files Browse the repository at this point in the history
  • Loading branch information
Blake Mizerany committed Oct 2, 2007
1 parent ca5f8f3 commit 09f4eac
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/sinatra/dsl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,12 @@ def #{env}
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

0 comments on commit 09f4eac

Please sign in to comment.