Revert "Break reliance on ActionController."

This reverts commit b3a2af7488.

Basically, we have an issue with ActionMailer::Base. Given this
code, we end up with

```
private method `new' called for ActionMailer::Base:Class
```

And That's Bad (tm).

Still that commit should point the way to making it happen somehow.
This commit is contained in:
Steve Klabnik 2012-08-28 22:57:15 -07:00
parent 4742405855
commit dc1b9a11cd
1 changed files with 1 additions and 5 deletions

View File

@ -1,12 +1,8 @@
module Draper
module ViewContext
def self.included(controller)
@controller = controller
end
def self.current
Thread.current[:current_view_context].tap do |context|
context ||= @controller.new.view_context
context ||= ApplicationController.new.view_context
context.controller.request ||= ActionController::TestRequest.new
context.request ||= context.controller.request
context.params ||= {}