Class: Footnotes::Notes::ViewNote

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

Direct Known Subclasses

ViewComponentNote

Instance Method Summary collapse

Methods inherited from AbstractNote

close!, #has_fieldset?, included?, #javascript, #legend, #onclick, start!, #stylesheet, #title, title, #to_sym, to_sym

Constructor Details

#initialize(controller) ⇒ ViewNote

Returns a new instance of ViewNote.



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

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

Instance Method Details



15
16
17
# File 'lib/rails-footnotes/notes/view_note.rb', line 15

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

#rowObject



11
12
13
# File 'lib/rails-footnotes/notes/view_note.rb', line 11

def row
  :edit
end

#valid?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/rails-footnotes/notes/view_note.rb', line 19

def valid?
  prefix? && first_render?
end