Sha256: b60e76dc251d96b5e8f0e5eb5bc02b2c2bafed5df7756d859e49bf063126c824

Contents?: true

Size: 617 Bytes

Versions: 1

Compression:

Stored size: 617 Bytes

Contents

# frozen_string_literal: true

class FeedsController < ApplicationController
  layout false
  before_action :check_bots

  def index
    @items =  Post.past
    @items += Structure.with_position(PositionType.footer).visible.sorted

    respond_to do |format|
      format.atom
      format.rss { redirect_to feeds_path(format: :atom), status: :moved_permanently }
      format.xml { redirect_to feeds_path(format: :atom), status: :moved_permanently }
    end
  end

  protected

  def check_bots
    # TODO
    # remove this shit
    redirect_to '/rss.xml' if ['62.210.215.115'].include?(request.remote_ip)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
translation_cms-0.1.5 app/controllers/feeds_controller.rb