Created
January 3, 2014 22:05
-
-
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).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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