require "#{File.dirname(__FILE__)}/abstract_note" module Footnotes module Notes class LayoutNote < AbstractNote def row :edit end def link escape(Footnotes::Filter.prefix(filename, 1, 1)) end def valid? prefix? && filename end protected def filename @filename ||= begin layout = Footnotes.view_subscriber.layout layout_glob = Rails.root.join("app/views", layout).to_s layout_glob += ".html*" Dir[layout_glob].first end end end end end