Files
danbooru/app/views/forum_topics/show.atom.builder
evazion 1c06ae9f81 atom feeds: fix deprecation warnings in *_path helpers.
DEPRECATION WARNING: You are calling a `*_path` helper with the
`only_path` option explicitly set to `false`. This option will stop
working on path helpers in Rails 5. Use the corresponding `*_url` helper
instead.
2017-07-01 11:45:28 -05:00

17 lines
598 B
Ruby

atom_feed(root_url: forum_topic_url(@forum_topic, host: Danbooru.config.hostname)) do |feed|
feed.title(@forum_topic.title)
feed.updated(@forum_topic.try(:updated_at))
@forum_posts.each do |post|
feed.entry(post, published: post.created_at, updated: post.updated_at) do |entry|
entry.title("@#{post.creator.name}: #{strip_dtext(post.body).truncate(50, separator: /[[:space:]]/)}")
entry.content(format_text(post.body), type: "html")
entry.author do |author|
author.name(post.creator.name)
author.uri(user_url(post.creator))
end
end
end
end