Class: MerbFootnotes::Notes::EnvNote

Inherits:
AbstractNote show all
Defined in:
lib/merb_footnotes/notes/env_note.rb

Instance Method Summary collapse

Methods inherited from AbstractNote

close!, #fieldset?, included?, #included?, #javascript, #legend, #link, #onclick, #row, start!, #stylesheet, #title, title, #to_sym, to_sym, #valid?

Constructor Details

#initialize(controller) ⇒ EnvNote

Returns a new instance of EnvNote.



6
7
8
# File 'lib/merb_footnotes/notes/env_note.rb', line 6

def initialize(controller)
  @env = controller.request.env.dup
end

Instance Method Details

#contentObject



10
11
12
13
14
15
16
# File 'lib/merb_footnotes/notes/env_note.rb', line 10

def content
  # Replace HTTP_COOKIE for a link
  @env['HTTP_COOKIE'] = '<a href="#" style="color:#009" onclick="footnotes_toogle(\'cookies_debug_info\');return false;" />See cookies on its tab</a>'

  # Create the env table
  mount_table(@env.to_a.sort.unshift([:key, :value]))
end