Class: Footnotes::Notes::ControllerNote

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

Instance Method Summary collapse

Methods inherited from AbstractNote

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

Constructor Details

#initialize(controller) ⇒ ControllerNote

Returns a new instance of ControllerNote.


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

def initialize(controller)
  @controller = controller
end

Instance Method Details


12
13
14
# File 'lib/rails-footnotes/notes/controller_note.rb', line 12

def link
  Footnotes::Filter.prefix(controller_filename, controller_line_number + 1, 3)
end

#rowObject


8
9
10
# File 'lib/rails-footnotes/notes/controller_note.rb', line 8

def row
  :edit
end

#valid?Boolean

Returns:

  • (Boolean)

16
17
18
# File 'lib/rails-footnotes/notes/controller_note.rb', line 16

def valid?
  prefix? && controller_filename && File.exists?(controller_filename)
end