Sha256: 71262355c360663be5c0f4c4d53375a23703b9cb401988599b69e6200e421a77

Contents?: true

Size: 683 Bytes

Versions: 9

Compression:

Stored size: 683 Bytes

Contents

module Wiselinks
  module ControllerMethods

    def self.included(base)
      base.helper_method :wiselinks_title
      base.before_filter :set_wiselinks_url
    end

  protected

    def wiselinks_layout
      'wiselinks'
    end

    def wiselinks_title(value)
      if self.request.wiselinks? && value.present?
        Wiselinks.log("title: #{value}")
        self.response.headers['X-Wiselinks-Title'] = URI.encode(value)
      end
    end

    def set_wiselinks_url
      # self.response.headers['X-Wiselinks-Url'] = request.env['REQUEST_URI'] if self.request.wiselinks?
      self.response.headers['X-Wiselinks-Url'] = request.url if self.request.wiselinks?
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
wiselinks-1.2.0 lib/wiselinks/controller_methods.rb
wiselinks-1.1.4 lib/wiselinks/controller_methods.rb
wiselinks-1.1.2 lib/wiselinks/controller_methods.rb
wiselinks-1.1.1 lib/wiselinks/controller_methods.rb
wiselinks-1.1.0 lib/wiselinks/controller_methods.rb
wiselinks-1.0.0 lib/wiselinks/controller_methods.rb
wiselinks-0.7.3 lib/wiselinks/controller_methods.rb
wiselinks-0.7.2 lib/wiselinks/controller_methods.rb
wiselinks-0.7.1 lib/wiselinks/controller_methods.rb