Created
February 21, 2012 19:02
-
-
Save gumayunov/1878173 to your computer and use it in GitHub Desktop.
File actionpack/lib/action_view/base.rb, line 255
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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