diff --git a/lib/rabl/sources.rb b/lib/rabl/sources.rb index 7875143..a15c65b 100644 --- a/lib/rabl/sources.rb +++ b/lib/rabl/sources.rb @@ -5,9 +5,11 @@ module Sources # Returns source for a given relative file # fetch_source("show", :view_path => "...") => "...contents..." def fetch_source(file, options = {}) - view_paths = Array(options[:view_path]) + Array(Rabl.configuration.view_paths) + custom_view_path = Array(options[:view_path]) + + Rabl.source_cache(file, custom_view_path) do + view_paths = custom_view_path + Array(Rabl.configuration.view_paths) - Rabl.source_cache(file, view_paths) do file_path = \ if defined?(Padrino) && context_scope.respond_to?(:settings) && context_scope.respond_to?(:resolve_template) fetch_padrino_source(file, options)