Created
February 16, 2014 07:11
-
-
Save masarufuruya/9030427 to your computer and use it in GitHub Desktop.
middlemanのブログ一覧をjsonで返すコード
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
<% | |
entries = [] | |
blog.articles.each do |article| | |
entry = { | |
:title => article.title, | |
:url => article.url, | |
:content => article.body | |
} | |
entries << entry | |
end | |
%><%=entries.to_json %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment