Skip to content

Instantly share code, notes, and snippets.

@tdreyno
Created November 3, 2009 18:39
Show Gist options
  • Save tdreyno/225308 to your computer and use it in GitHub Desktop.
Save tdreyno/225308 to your computer and use it in GitHub Desktop.
def find_and_include_related_sass_file
path = request.path_info.dup
path << self.class.index_file if path.match(%r{/$})
path.gsub!(%r{^/}, '')
path.gsub!(File.extname(path), '')
path.gsub!('/', '-')
sass_file = File.join(File.basename(self.class.views), self.class.css_dir, "#{path}.css.sass")
if File.exists? sass_file
stylesheet_link_tag "#{path}.css"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment