Sha256: bf1b684d8cb5196fa285ddb9883195fce3d89d791458ed6e80ce9571a9e9db92

Contents?: true

Size: 468 Bytes

Versions: 1

Compression:

Stored size: 468 Bytes

Contents

module Mvp
  module SEOConcern
    extend ActiveSupport::Concern

    private

    included do
      before_action :force_no_trailing_slash
      helper_method :page
    end

    def force_no_trailing_slash
      return if request.path == '/'
      redirect_to request.original_url.gsub(/\/$/,'') if request.original_url.match(/\/$/)
    end

    def page
      @page ||= begin
        h = Hashie::Mash.new
        h.classes = []
        h
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
minimum-viable-product-0.0.2 app/controllers/mvp/concerns/seo_concern.rb