railsfrance/railsfrance.org

View on GitHub
app/views/questions/index.atom.builder

Summary

Maintainability
Test Coverage
atom_feed language: 'fr' do |feed|
  feed.title "RailsFrance > Questions"
  if @questions.any?
    feed.updated @questions.first.created_at

    @questions.each do |item|
      feed.entry(item) do |entry|
        entry.url question_url(item)
        entry.title item.title
        entry.content markdown(item.description), type: 'html'

        entry.updated(item.updated_at.strftime("%Y-%m-%dT%H:%M:%SZ"))

        entry.author do |author|
          author.name item.user_username
        end
      end
    end
  end
end