Permalink
Browse files

Hide InlineTemplate class from ActionController and use ActionView's …

…render API
  • Loading branch information...
1 parent ad77240 commit a9259ccfe05690dc4cb7993d551603c39619c27f @josh josh committed Jun 25, 2008
Showing with 6 additions and 8 deletions.
  1. +1 −2 actionpack/lib/action_controller/base.rb
  2. +5 −6 actionpack/lib/action_view/base.rb
@@ -859,8 +859,7 @@ def render(options = nil, extra_options = {}, &block) #:doc:
elsif inline = options[:inline]
add_variables_to_assigns
- tmpl = ActionView::InlineTemplate.new(@template, options[:inline], options[:locals], options[:type])
- render_for_text(@template.render_template(tmpl), options[:status])
+ render_for_text(@template.render(options), options[:status])
elsif action_name = options[:action]
template = default_template_name(action_name.to_s)
@@ -256,16 +256,11 @@ def render(options = {}, local_assigns = {}, &block) #:nodoc:
elsif options[:partial]
render_partial(options[:partial], ActionView::Base::ObjectWrapper.new(options[:object]), options[:locals])
elsif options[:inline]
- template = InlineTemplate.new(self, options[:inline], options[:locals], options[:type])
- render_template(template)
+ render_inline(options[:inline], options[:locals], options[:type])
end
end
end
- def render_template(template) #:nodoc:
- template.render_template
- end
-
# Returns true is the file may be rendered implicitly.
def file_public?(template_path)#:nodoc:
template_path.split('/').last[0,1] != '_'
@@ -323,6 +318,10 @@ def render_file(template_path, use_full_path = true, local_assigns = {}) #:nodoc
Template.new(self, template_path, use_full_path, local_assigns).render_template
end
+ def render_inline(text, local_assigns = {}, type = nil)
+ InlineTemplate.new(self, text, local_assigns, type).render_template
+ end
+
def wrap_content_for_layout(content)
original_content_for_layout, @content_for_layout = @content_for_layout, content
yield

0 comments on commit a9259cc

Please sign in to comment.