-
-
Save freshtonic/76787 to your computer and use it in GitHub Desktop.
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
# So this is in my controller: | |
@items = Dir.glob("views/*/*").map do |item| | |
item.gsub(/views\/.+\/(.+).haml/, '\1') | |
end.select do |item| | |
!item.match(/^hide-/) && x != "index") | |
end | |
# Its contents look like this: | |
# views/controls/actions.haml | |
# views/controls/buttons.haml | |
# views/controls/formForge.haml | |
# views/controls/hide-actions.haml | |
# views/controls/index.haml | |
# views/controls/navigation.haml | |
# views/controls/tree.haml | |
# views/dialogs/browser.haml | |
# views/dialogs/dialogBox.haml | |
# No need to check if @items exists, it will be an empty array at least. | |
- @items.each do |item| | |
%p do some stuff with item | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment