Sha256: 07855fbd280f6d69100d12406d8a53eae12b0f98e0463ea3b2c242a2e2d350a9

Contents?: true

Size: 602 Bytes

Versions: 30

Compression:

Stored size: 602 Bytes

Contents

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

30 entries across 30 versions & 2 rubygems

Version Path
rails-footnotes-7.1.0 lib/rails-footnotes/notes/layout_note.rb
rails-footnotes-7.0.1 lib/rails-footnotes/notes/layout_note.rb
rails-footnotes-7.0.0 lib/rails-footnotes/notes/layout_note.rb
rails-footnotes-5.0.0 lib/rails-footnotes/notes/layout_note.rb
rails6-footnotes-5.0.2 lib/rails-footnotes/notes/layout_note.rb
rails6-footnotes-5.0.1 lib/rails-footnotes/notes/layout_note.rb
rails6-footnotes-5.0.0 lib/rails-footnotes/notes/layout_note.rb
rails-footnotes-4.1.8 lib/rails-footnotes/notes/layout_note.rb
rails-footnotes-4.1.7 lib/rails-footnotes/notes/layout_note.rb
rails-footnotes-4.1.6 lib/rails-footnotes/notes/layout_note.rb
rails-footnotes-4.1.5 lib/rails-footnotes/notes/layout_note.rb
rails-footnotes-4.1.4 lib/rails-footnotes/notes/layout_note.rb
rails-footnotes-4.1.3 lib/rails-footnotes/notes/layout_note.rb
rails-footnotes-4.1.2 lib/rails-footnotes/notes/layout_note.rb
rails-footnotes-4.1.1 lib/rails-footnotes/notes/layout_note.rb
rails-footnotes-4.1.0 lib/rails-footnotes/notes/layout_note.rb
rails-footnotes-4.0.2 lib/rails-footnotes/notes/layout_note.rb
rails-footnotes-4.0.1 lib/rails-footnotes/notes/layout_note.rb
rails-footnotes-4.0.0 lib/rails-footnotes/notes/layout_note.rb
rails-footnotes-3.7.9 lib/rails-footnotes/notes/layout_note.rb