Receives a view object and return a template similar to self by using @virtual_path.
This method is useful if you have a template object but it does not contain its source anymore since it was already compiled. In such cases, all you need to do is to call refresh passing in the view object.
Notice this method raises an error if the template to be refreshed does not have a virtual path set (true just for inline templates).
# File actionpack/lib/action_view/template.rb, line 163 def refresh(view) raise "A template needs to have a virtual path in order to be refreshed" unless @virtual_path lookup = view.lookup_context pieces = @virtual_path.split("/") name = pieces.pop partial = !!name.sub!(/^_/, "") lookup.disable_cache do lookup.find_template(name, [ pieces.join('/') ], partial, @locals) end end