aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view
diff options
context:
space:
mode:
authorYehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>2009-05-21 16:35:40 -0700
committerYehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>2009-05-21 16:35:40 -0700
commit6923b392b740f2346326634532b40cf24a0f26ef (patch)
tree55a6486563e8d9a408c1dd8c7628e85c88af570e /actionpack/lib/action_view
parente773d0e68ac64bd26d86860a9a8e0048e2b6bb48 (diff)
downloadrails-6923b392b740f2346326634532b40cf24a0f26ef.tar.gz
rails-6923b392b740f2346326634532b40cf24a0f26ef.tar.bz2
rails-6923b392b740f2346326634532b40cf24a0f26ef.zip
Added the :rjs render option
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r--actionpack/lib/action_view/base.rb17
-rw-r--r--actionpack/lib/action_view/helpers/prototype_helper.rb2
-rw-r--r--actionpack/lib/action_view/template/handler.rb1
3 files changed, 12 insertions, 8 deletions
diff --git a/actionpack/lib/action_view/base.rb b/actionpack/lib/action_view/base.rb
index 6b72d406af..4ab568b44c 100644
--- a/actionpack/lib/action_view/base.rb
+++ b/actionpack/lib/action_view/base.rb
@@ -269,15 +269,16 @@ module ActionView #:nodoc:
nil
end
- private
- # Evaluates the local assigns and controller ivars, pushes them to the view.
- def _evaluate_assigns_and_ivars #:nodoc:
- unless @assigns_added
- @assigns.each { |key, value| instance_variable_set("@#{key}", value) }
- _copy_ivars_from_controller
- @assigns_added = true
- end
+ # Evaluates the local assigns and controller ivars, pushes them to the view.
+ def _evaluate_assigns_and_ivars #:nodoc:
+ unless @assigns_added
+ @assigns.each { |key, value| instance_variable_set("@#{key}", value) }
+ _copy_ivars_from_controller
+ @assigns_added = true
end
+ end
+
+ private
def _copy_ivars_from_controller #:nodoc:
if @controller
diff --git a/actionpack/lib/action_view/helpers/prototype_helper.rb b/actionpack/lib/action_view/helpers/prototype_helper.rb
index 1fbe012a95..c0f5df3468 100644
--- a/actionpack/lib/action_view/helpers/prototype_helper.rb
+++ b/actionpack/lib/action_view/helpers/prototype_helper.rb
@@ -1,5 +1,6 @@
require 'set'
require 'active_support/json'
+require 'active_support/core_ext/object/extending'
module ActionView
module Helpers
@@ -572,6 +573,7 @@ module ActionView
# #include_helpers_from_context has nothing to overwrite.
class JavaScriptGenerator #:nodoc:
def initialize(context, &block) #:nodoc:
+ context._evaluate_assigns_and_ivars
@context, @lines = context, []
include_helpers_from_context
@context.with_output_buffer(@lines) do
diff --git a/actionpack/lib/action_view/template/handler.rb b/actionpack/lib/action_view/template/handler.rb
index 3481a4a4e7..3071c78174 100644
--- a/actionpack/lib/action_view/template/handler.rb
+++ b/actionpack/lib/action_view/template/handler.rb
@@ -1,4 +1,5 @@
require "active_support/core_ext/class/inheritable_attributes"
+require "action_dispatch/http/mime_type"
# Legacy TemplateHandler stub
module ActionView