Sha256: cadb6941cd68a36647a457db0a7444883dda9f2f15cbc27250a6b6cbacf49f60

Contents?: true

Size: 660 Bytes

Versions: 16

Compression:

Stored size: 660 Bytes

Contents

module Footnotes
  module Notes
    class EnvNote < AbstractNote
      def initialize(controller)
        @env = controller.request.env.dup
      end

      def content
        env_data = @env.map { |k, v|
          case k
          when 'HTTP_COOKIE'
            # Replace HTTP_COOKIE for a link
            [k.to_s, '<a href="#" style="color:#009" onclick="Footnotes.hideAllAndToggle(\'cookies_debug_info\');return false;">See cookies on its tab</a>']
          else
            [k.to_s, escape(v.to_s)]
          end
        }.sort.unshift([ :key, escape('value') ])

        # Create the env table
        mount_table(env_data)
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
rails-footnotes-7.1.0 lib/rails-footnotes/notes/env_note.rb
rails-footnotes-7.0.1 lib/rails-footnotes/notes/env_note.rb
rails-footnotes-7.0.0 lib/rails-footnotes/notes/env_note.rb
rails-footnotes-5.0.0 lib/rails-footnotes/notes/env_note.rb
rails6-footnotes-5.0.2 lib/rails-footnotes/notes/env_note.rb
rails6-footnotes-5.0.1 lib/rails-footnotes/notes/env_note.rb
rails6-footnotes-5.0.0 lib/rails-footnotes/notes/env_note.rb
rails-footnotes-4.1.8 lib/rails-footnotes/notes/env_note.rb
rails-footnotes-4.1.7 lib/rails-footnotes/notes/env_note.rb
rails-footnotes-4.1.6 lib/rails-footnotes/notes/env_note.rb
rails-footnotes-4.1.5 lib/rails-footnotes/notes/env_note.rb
rails-footnotes-4.1.4 lib/rails-footnotes/notes/env_note.rb
rails-footnotes-4.1.3 lib/rails-footnotes/notes/env_note.rb
rails-footnotes-4.1.2 lib/rails-footnotes/notes/env_note.rb
rails-footnotes-4.1.1 lib/rails-footnotes/notes/env_note.rb
rails-footnotes-4.1.0 lib/rails-footnotes/notes/env_note.rb