diff options
author | Logan Fick <logaldeveloper@protonmail.com> | 2017-11-11 21:11:59 -0500 |
---|---|---|
committer | Logan Fick <logaldeveloper@protonmail.com> | 2017-11-11 21:11:59 -0500 |
commit | 777ebca7f2521aeb6b78216ce4539445b0818a5c (patch) | |
tree | a69af0a5ccba84030d8d7e4e06858d1d34959a6a /app | |
parent | 34cb9e9dfc1de0663cb3b67395b5bc01e0fd9ab0 (diff) |
Added atom feed to forums.
Diffstat (limited to 'app')
-rw-r--r-- | app/views/forums/show.atom.builder | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/app/views/forums/show.atom.builder b/app/views/forums/show.atom.builder new file mode 100644 index 0000000..f484655 --- /dev/null +++ b/app/views/forums/show.atom.builder @@ -0,0 +1,19 @@ +atom_feed do |feed| + feed.title "Latest threads in " + @forum.name + feed.updated Time.now + + @threads.limit(100).each do |thread| + unless thread.sticky? + feed.entry thread do |entry| + entry.updated thread.updated_at + entry.author do |a| + a.name thread.author.name + a.uri user_url(thread.author) + end + entry.url forumthread_url(thread) + entry.title thread.title + entry.content render_md(thread.content).html_safe, :type => 'html' + end + end + end +end |