Sha256: fe3d92ef3eef5deb5e1c93193fe79fb2472208cb5172a0a668a2bd45d8a1c5fa

Contents?: true

Size: 745 Bytes

Versions: 5

Compression:

Stored size: 745 Bytes

Contents

module Radiant
  module ViewPathsExtension
  
    def self.included(base)
      base.class_eval %{
        cattr_accessor :view_paths
        self.view_paths = [ActionController::Base.template_root].compact
        alias full_template_path_without_paths full_template_path
        alias full_template_path full_template_path_with_paths
      }
    end
  
    def full_template_path_with_paths (template_path, extension)
      view_paths.reverse_each do |path|
        full_path = File.join(path, "#{template_path}.#{extension}")
        return full_path if File.exists?(full_path)
      end
      full_template_path_without_paths(template_path, extension)
    end
  
  end
end
ActionView::Base.class_eval { include Radiant::ViewPathsExtension }

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
radiant-0.6.0 lib/plugins/extension_patches/lib/view_paths_extension.rb
radiant-0.6.1 lib/plugins/extension_patches/lib/view_paths_extension.rb
radiant-0.6.2 lib/plugins/extension_patches/lib/view_paths_extension.rb
radiant-0.6.3 lib/plugins/extension_patches/lib/view_paths_extension.rb
radiant-0.6.4 lib/plugins/extension_patches/lib/view_paths_extension.rb