Skip to content
Browse files

Merge branch 'compat-1-0-11' into dd-ruby_19_compat

  • Loading branch information...
2 parents 7589989 + ec032c9 commit a71e9fe014af51935a1f662d08b5045799aea1f0 @ddemaree ddemaree committed Jul 23, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 merb-core/lib/merb-core/controller/mixins/render.rb
View
4 merb-core/lib/merb-core/controller/mixins/render.rb
@@ -123,6 +123,8 @@ def render(thing = nil, opts = {})
template_method, template_location =
_template_for(thing, content_type, controller_name, opts[:template])
+ @virtual_path = template_location.sub(Rails.root.join('app/views'),'').gsub(/\.(?:html|erb)/, '').sub(/^\//, '')
+
# Raise an error if there's no template
unless template_method && self.respond_to?(template_method)
template_files = Merb::Template.template_extensions.map { |ext| "#{template_location}.#{ext}" }
@@ -314,6 +316,8 @@ def partial(template, opts={})
template_path,
locals.keys)
+ @virtual_path = template_location.sub(Rails.root.join('app/views'),'').gsub(/\.(?:html|erb)/, '').sub(/^\//, '')
+
# this handles an edge-case where the name of the partial is _foo.* and your opts
# have :foo as a key.
named_local = opts.key?(as)

0 comments on commit a71e9fe

Please sign in to comment.
Something went wrong with that request. Please try again.