Class: Footnotes::Notes::ViewNote

Inherits:
AbstractNote show all
Defined in:
lib/rails-footnotes/notes/view_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) ⇒ ViewNote

Returns a new instance of ViewNote.



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

def initialize(controller)
  @controller = controller
  @template = controller.instance_variable_get(:@template)
end

Instance Method Details



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

def link
  escape(Footnotes::Filter.prefix(filename, 1, 1))
end

#rowObject



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

def row
  :edit
end

#valid?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/rails-footnotes/notes/view_note.rb', line 17

def valid?
  prefix? && first_render?
end