Sha256: e1ddb1d083bb6d5ce9131fb44a4e66e047456295698e41853e546cc86b854ea2

Contents?: true

Size: 646 Bytes

Versions: 14

Compression:

Stored size: 646 Bytes

Contents

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

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

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

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
rails-footnotes-4.0.2 lib/rails-footnotes/notes/env_note.rb
rails-footnotes-4.0.1 lib/rails-footnotes/notes/env_note.rb
rails-footnotes-4.0.0 lib/rails-footnotes/notes/env_note.rb
rails-footnotes-3.7.9 lib/rails-footnotes/notes/env_note.rb
rails-footnotes-3.7.8 lib/rails-footnotes/notes/env_note.rb
rails-footnotes-3.7.7 lib/rails-footnotes/notes/env_note.rb
rails-footnotes-3.7.6 lib/rails-footnotes/notes/env_note.rb
rails-footnotes-3.7.5 lib/rails-footnotes/notes/env_note.rb
rails-footnotes-3.7.5.rc4 lib/rails-footnotes/notes/env_note.rb
rails-footnotes-3.7.5.rc3 lib/rails-footnotes/notes/env_note.rb
rails-footnotes-3.7.5.rc2 lib/rails-footnotes/notes/env_note.rb
rails-footnotes-3.7.5.rc1 lib/rails-footnotes/notes/env_note.rb
rails-footnotes-3.7.4 lib/rails-footnotes/notes/env_note.rb
rails-footnotes-3.7.3 lib/rails-footnotes/notes/env_note.rb