Skip to content

Instantly share code, notes, and snippets.

@cesarfigueroa
Created January 3, 2014 22:05
Show Gist options
  • Save cesarfigueroa/8247544 to your computer and use it in GitHub Desktop.
Save cesarfigueroa/8247544 to your computer and use it in GitHub Desktop.
Determine what directories a view lives in based on the current route (in Sinatra).
def view_directories
request.path_info.split('/').select do |path|
Dir.entries(settings.views).include?(path)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment