diff options
author | Carl Lerche <carllerche@mac.com> | 2009-03-20 16:13:13 -0700 |
---|---|---|
committer | Yehuda Katz <wycats@gmail.com> | 2009-03-23 10:23:14 -0700 |
commit | 81e814adfad6d4bba1af5f70a5a409f6d71f8f6c (patch) | |
tree | a1dfa746191d7509f6f695b2e99d5a7f79278b91 /actionpack/lib/action_view/template | |
parent | 90c079a7814a9a996c8cbe353015c080fafce2bc (diff) | |
download | rails-81e814adfad6d4bba1af5f70a5a409f6d71f8f6c.tar.gz rails-81e814adfad6d4bba1af5f70a5a409f6d71f8f6c.tar.bz2 rails-81e814adfad6d4bba1af5f70a5a409f6d71f8f6c.zip |
Working on being able to render :text with layouts
Diffstat (limited to 'actionpack/lib/action_view/template')
-rw-r--r-- | actionpack/lib/action_view/template/renderable.rb | 7 | ||||
-rw-r--r-- | actionpack/lib/action_view/template/template.rb | 2 | ||||
-rw-r--r-- | actionpack/lib/action_view/template/text.rb | 9 |
3 files changed, 17 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/template/renderable.rb b/actionpack/lib/action_view/template/renderable.rb index 35c832aaba..fde37544f3 100644 --- a/actionpack/lib/action_view/template/renderable.rb +++ b/actionpack/lib/action_view/template/renderable.rb @@ -4,6 +4,13 @@ module ActionView module Renderable #:nodoc: extend ActiveSupport::Memoizable + def render(view, locals) + compile(locals) + view.send(method_name(locals), locals) {|*args| yield(*args) } + end + + private + def filename 'compiled-template' end diff --git a/actionpack/lib/action_view/template/template.rb b/actionpack/lib/action_view/template/template.rb index 1ee073c3e9..73e319b489 100644 --- a/actionpack/lib/action_view/template/template.rb +++ b/actionpack/lib/action_view/template/template.rb @@ -206,7 +206,7 @@ module ActionView #:nodoc: def load! @cached = true - freeze + # freeze end private diff --git a/actionpack/lib/action_view/template/text.rb b/actionpack/lib/action_view/template/text.rb new file mode 100644 index 0000000000..f81174d707 --- /dev/null +++ b/actionpack/lib/action_view/template/text.rb @@ -0,0 +1,9 @@ +module ActionView #:nodoc: + class TextTemplate < String #:nodoc: + + def render(*) self end + + def exempt_from_layout?() false end + + end +end |