Sha256: 88fb370c1113d333da184609b647c5ee31aaf8e000647496a2207a144a40d7f8

Contents?: true

Size: 600 Bytes

Versions: 7

Compression:

Stored size: 600 Bytes

Contents

module RailsSitemap
  class AttachmentController < ApplicationController
    include RailsSitemap::ActAsSitemap

    before_action :set_images

    def index
      respond_to do |format|
        format.xml
      end
    end

    private

    def set_images
      asset_images = Dir["#{Rails.root}/app/assets/images/*.{jpg,png,gif,svg}"]

      @image_entries = asset_images.map do |asset_image|
        image_name = asset_image.split('/').last
        image_path = ActionController::Base.helpers.asset_path(image_name)

        ImageEntry.new(image_path, @current_domain)
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rails_sitemap-0.2.5 app/controllers/rails_sitemap/attachment_controller.rb
rails_sitemap-0.2.4 app/controllers/rails_sitemap/attachment_controller.rb
rails_sitemap-0.2.3 app/controllers/rails_sitemap/attachment_controller.rb
rails_sitemap-0.2.2 app/controllers/rails_sitemap/attachment_controller.rb
rails_sitemap-0.2.1 app/controllers/rails_sitemap/attachment_controller.rb
rails_sitemap-0.2.0 app/controllers/rails_sitemap/attachment_controller.rb
rails_sitemap-0.1.0 app/controllers/rails_sitemap/attachment_controller.rb