screenconcept/qbrick

View on GitHub
app/controllers/qbrick/sitemaps_controller.rb

Summary

Maintainability
A
0 mins
Test Coverage
module Qbrick
  class SitemapsController < ::ApplicationController
    def index
      last_page = Qbrick::Page.published.last
      return unless stale?(etag: last_page, last_modified: last_page.updated_at.utc)

      respond_to do |format|
        format.html
        format.xml { @pages = Qbrick::Page.all }
      end
    end
  end
end