问题是
render(context, options)
Main render entry point shared by AV and AC.
Source: hide | on GitHub
# File actionpack/lib/action_view/renderer/renderer.rb, line 1313:defrender(context,options)14:ifoptions.key?(:partial)15:render_partial(context,options)16:else17:render_template(context,options)18:end19:end
moduleActionViewmoduleHelpers# = Action View Rendering## Implements methods that allow rendering from a view context.# In order to use this module, all you need is to implement# view_renderer that returns an ActionView::Renderer object.moduleRenderingHelper# Returns the result of a render that's dictated by the options hash. The primary options are:## * <tt>:partial</tt> - See <tt>ActionView::PartialRenderer</tt>.# * <tt>:file</tt> - Renders an explicit template file (this used to be the old default), add :locals to pass in those.# * <tt>:inline</tt> - Renders an inline template similar to how it's done in the controller.# * <tt>:text</tt> - Renders the text passed in out.## If no options hash is passed or :update specified, the default is to render a partial and use the second parameter# as the locals hash.defrender(options={},locals={},&block)caseoptionswhenHashifblock_given?view_renderer.render_partial(self,options.merge(:partial=>options[:layout]),&block)elseview_renderer.render(self,options)endelseview_renderer.render_partial(self,:partial=>options,:locals=>locals)endend
看到这个注释很熟悉了吗?
You need to Sign in before reply, if you don't have an account, please Sign up first.