Created
August 31, 2014 16:34
-
-
Save crudh/c8faa08ee98e8c4a70c4 to your computer and use it in GitHub Desktop.
Scala/Play RSS example
This file contains hidden or 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 rss = Action { implicit request => | |
| Ok( | |
| <rss version="2.0"> | |
| <channel> | |
| <title>News Application</title> | |
| <link>{ routes.Application.index.absoluteURL(false) }</link> | |
| <description>News Application</description> | |
| { NewsArticle.all.map { newsArticle => | |
| <item> | |
| <title>{ newsArticle.title }</title> | |
| <link>{ routes.News.article(newsArticle.id).absoluteURL(false) }</link> | |
| <description>{ newsArticle.text }</description> | |
| </item> | |
| }} | |
| </channel> | |
| </rss> | |
| ) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment