Created
May 31, 2016 19:56
-
-
Save g8d3/aefb719b46056d9a4f328479c80a375d 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
@documents_by_category = Document.all.group_by{|doc| doc.category.name} |
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
json.array! @documents_by_category each do |category, docs| | |
json.set! category, docs | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment