lib/rails-footnotes/notes/layout_note.rb in rails3-footnotes-4.0.0.pre.5 vs lib/rails-footnotes/notes/layout_note.rb in rails3-footnotes-4.0.0.pre.6
- old
+ new
@@ -16,10 +16,15 @@
prefix? && filename
end
protected
def filename
- Dir[Footnotes.view_subscriber.layout.to_s+".html*"].first
+ @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