Skip to content

Commit

Permalink
Merge branch 'compat-1-0-11' into dd-ruby_19_compat
Browse files Browse the repository at this point in the history
  • Loading branch information
David Demaree committed Jul 23, 2012
2 parents 7589989 + ec032c9 commit a71e9fe
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions merb-core/lib/merb-core/controller/mixins/render.rb
Expand Up @@ -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}" }
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit a71e9fe

Please sign in to comment.