Skip to content

Instantly share code, notes, and snippets.

@rkh
Created September 11, 2010 09:20
Show Gist options
  • Select an option

  • Save rkh/575021 to your computer and use it in GitHub Desktop.

Select an option

Save rkh/575021 to your computer and use it in GitHub Desktop.
require 'sinatra'
helpers do
def haml(template, options = {}, *)
if template.to_s.start_with? 'in/'
options[:layout] ||= :'in/layout'
end
super
end
end
@davesag
Copy link
Copy Markdown

davesag commented Sep 11, 2010

Thanks. Cleaned that up a bit as 'templates' should be 'template' and '/in' should be 'in/'

helpers do
def haml(template, options = {}, *)
if template.to_s.start_with? 'in/'
options[:layout] ||= :'in/layout'
end
super
end
end

@rkh
Copy link
Copy Markdown
Author

rkh commented Sep 11, 2010

Yeah, true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment