Skip to content
Browse files

Make this less brittle and work on 1.8

  • Loading branch information...
1 parent 428c0bd commit cb8b0f4a5aac04a327a884b5413ccdb184715da8 @wycats wycats committed Oct 15, 2009
Showing with 9 additions and 9 deletions.
  1. +9 −9 actionpack/lib/action_view/base.rb
View
18 actionpack/lib/action_view/base.rb
@@ -241,16 +241,16 @@ def self.for_controller(controller)
# they are in AC.
if controller.class.respond_to?(:_helper_serial)
klass = @views[controller.class._helper_serial] ||= Class.new(self) do
- const_set(:CONTROLLER_CLASS, controller.class)
-
# Try to make stack traces clearer
- def self.name
- "ActionView for #{CONTROLLER_CLASS}"
- end
-
- def inspect
- "#<#{self.class.name}>"
- end
+ class_eval <<-ruby_eval, __FILE__, __LINE__ + 1
+ def self.name
+ "ActionView for #{controller.class}"
+ end
+
+ def inspect
+ "#<#{self.class.name}>"
+ end
+ ruby_eval
if controller.respond_to?(:_helpers)
include controller._helpers

0 comments on commit cb8b0f4

Please sign in to comment.
Something went wrong with that request. Please try again.