Class: Footnotes::Notes::RoutesNote

Inherits:
AbstractNote show all
Defined in:
lib/rails-footnotes/notes/routes_note.rb

Instance Method Summary collapse

Methods inherited from AbstractNote

close!, #escape, #has_fieldset?, #hash_to_xml_attributes, included?, #javascript, #link, #mount_table, #mount_table_for_hash, #onclick, #prefix?, #row, start!, #stylesheet, #title, title, #to_sym, to_sym, #valid?

Constructor Details

#initialize(controller) ⇒ RoutesNote

Returns a new instance of RoutesNote.



4
5
6
7
# File 'lib/rails-footnotes/notes/routes_note.rb', line 4

def initialize(controller)
  @controller = controller
  @parsed_routes = parse_routes
end

Instance Method Details

#contentObject



13
14
15
# File 'lib/rails-footnotes/notes/routes_note.rb', line 13

def content
  mount_table(@parsed_routes.unshift([:path, :name, :options, :requirements]), :summary => "Debug information for #{title}")
end

#legendObject



9
10
11
# File 'lib/rails-footnotes/notes/routes_note.rb', line 9

def legend
  "Routes for #{@controller.class.to_s}"
end