Class: Footnotes::Notes::PartialsNote
- Inherits:
-
LogNote
- Object
- AbstractNote
- LogNote
- Footnotes::Notes::PartialsNote
- Defined in:
- lib/rails-footnotes/notes/partials_note.rb
Instance Method Summary collapse
- #content ⇒ Object
-
#initialize(controller) ⇒ PartialsNote
constructor
A new instance of PartialsNote.
- #title ⇒ Object
Methods inherited from AbstractNote
close!, #has_fieldset?, included?, #javascript, #legend, #link, #onclick, #row, start!, #stylesheet, title, #to_sym, to_sym, #valid?
Constructor Details
#initialize(controller) ⇒ PartialsNote
Returns a new instance of PartialsNote.
6 7 8 9 10 |
# File 'lib/rails-footnotes/notes/partials_note.rb', line 6 def initialize(controller) @controller = controller @template = controller.instance_variable_get('@template') @partials = get_partials end |
Instance Method Details
#content ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/rails-footnotes/notes/partials_note.rb', line 12 def content result = '<ul>' @partials.collect.each do |partial| full_filename = File.join(File.(RAILS_ROOT), 'app', 'views', partial.first.to_s) result += "<li><a href='#{Footnotes::Filter.prefix}#{full_filename}'>" result += "#{partial.last}</a></li>" end result += '</ul>' result end |
#title ⇒ Object
24 25 26 |
# File 'lib/rails-footnotes/notes/partials_note.rb', line 24 def title "Partials (#{@partials.length})" end |