Permalink
Browse files

Fixed: view_path option not taken into account

Passing a view_path option to partial or extend is only taken into account if fetch_rails_source returns nil / false, but instead it raised an exception if it couldn't find anything
  • Loading branch information...
sebastianludwig committed Nov 18, 2012
1 parent 1c8a75b commit 32577284fe1d54b5eee985e848be55b01c2a5556
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/rabl/partials.rb
View
@@ -76,7 +76,11 @@ def fetch_rails_source(file, options={})
source_format = rendered_format unless rendered_format == :html
context_scope.lookup_context.find(file, [], partial, [], {:formats => [source_format]})
end }
- template = lookup_proc.call(false) rescue lookup_proc.call(true)
+ begin
+ template = lookup_proc.call(false)
+ rescue
+ lookup_proc.call(true) rescue return nil
+ end
template.identifier if template
elsif source_format && context_scope.respond_to?(:view_paths) # Rails 2
template = context_scope.view_paths.find_template(file, source_format, false)

0 comments on commit 3257728

Please sign in to comment.