Sha256: a6fdaa31fd5f1696ed3060cfe6acab155ddbdf8de7bdb78387d3fa9c4a8ceb2e

Contents?: true

Size: 688 Bytes

Versions: 1

Compression:

Stored size: 688 Bytes

Contents

require "#{File.dirname(__FILE__)}/abstract_note"

module Footnotes
  module Notes
    class LayoutNote < AbstractNote
      def initialize(controller)
        @controller = controller
        @template = @controller.instance_variable_get('@template')
      end

      def row
        :edit
      end

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

      def valid?
        prefix? && @controller.active_layout
      end

      protected
        def filename
          file = @template.send(:_pick_template, @controller.active_layout)
          File.join(File.expand_path(RAILS_ROOT), 'app', 'views', file.to_s)          
        end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ceritium-rails-footnotes-3.4.1.1 lib/rails-footnotes/notes/layout_note.rb