Skip to content

Instantly share code, notes, and snippets.

@gumayunov
Created February 21, 2012 19:02
Show Gist options
  • Save gumayunov/1878173 to your computer and use it in GitHub Desktop.
Save gumayunov/1878173 to your computer and use it in GitHub Desktop.
File actionpack/lib/action_view/base.rb, line 255
def render(options = {}, local_assigns = {}, &block) #:nodoc:
local_assigns ||= {}
case options
when Hash
options = options.reverse_merge(:locals => {})
if options[:layout]
_render_with_layout(options, local_assigns, &block)
elsif options[:file]
template = self.view_paths.find_template(options[:file], template_format)
template.render_template(self, options[:locals])
elsif options[:partial]
render_partial(options)
elsif options[:inline]
InlineTemplate.new(options[:inline], options[:type]).render(self, options[:locals])
elsif options[:text]
options[:text]
end
when :update
update_page(&block)
else
render_partial(:partial => options, :locals => local_assigns)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment