Class: MerbFootnotes::Notes::PartialsNote

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

Instance Method Summary collapse

Methods inherited from AbstractNote

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

Constructor Details

#initialize(controller) ⇒ PartialsNote

Returns a new instance of PartialsNote.



9
10
11
12
# File 'lib/merb_footnotes/notes/partials_note.rb', line 9

def initialize(controller)
  @controller = controller
  @partials = format_partials(@controller.footnotes[:partials])
end

Instance Method Details

#contentObject

def link

escape(Merb::Plugins.config[:merb_footnotes][:prefix] + filename)

end



26
27
28
# File 'lib/merb_footnotes/notes/partials_note.rb', line 26

def content
  mount_table(@partials.unshift([:partial, :arguments]))
end

#rowObject



14
15
16
# File 'lib/merb_footnotes/notes/partials_note.rb', line 14

def row
  :edit
end

#titleObject



18
19
20
# File 'lib/merb_footnotes/notes/partials_note.rb', line 18

def title
  "Partials (#{@partials.size})"
end

#valid?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/merb_footnotes/notes/partials_note.rb', line 30

def valid?
  prefix?
end