Sha256: afd260a9ea3f4142beb07b974dcef7c0c750ead2abb649fa04e8cb46af4eabed

Contents?: true

Size: 653 Bytes

Versions: 8

Compression:

Stored size: 653 Bytes

Contents

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

module Footnotes
  module Notes
    class LayoutNote < AbstractNote
      def initialize(controller)
        @controller = controller
      end

      def row
        :edit
      end

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

      def valid?
        prefix? && nil#@controller.active_layout TODO doesn't work with Rails 3
      end

      protected
        def filename
          File.join(File.expand_path(Rails.root), 'app', 'layouts', "#{@controller.active_layout.to_s.underscore}").sub('/layouts/layouts/', '/views/layouts/')
        end
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
rails-footnotes-3.7.2 lib/rails-footnotes/notes/layout_note.rb
rails-footnotes-3.7.1 lib/rails-footnotes/notes/layout_note.rb
rails-footnotes-3.7.1.pre lib/rails-footnotes/notes/layout_note.rb
rails3-footnotes-4.0.0.pre.3 lib/rails-footnotes/notes/layout_note.rb
rails-footnotes-3.7.0 lib/rails-footnotes/notes/layout_note.rb
rails3-footnotes-4.0.0.pre.2 lib/rails-footnotes/notes/layout_note.rb
rails3-footnotes-4.0.0.pre.1 lib/rails-footnotes/notes/layout_note.rb
rails3-footnotes-4.0.0.pre lib/rails-footnotes/notes/layout_note.rb