Prime view context on Rails console boot.

Fixes #168
This commit is contained in:
Steve Klabnik 2012-05-11 22:55:41 -04:00
parent 12aec9c0b4
commit 738074f986
1 changed files with 7 additions and 0 deletions

View File

@ -46,5 +46,12 @@ module Draper
end
end
console do
require 'action_controller/test_case'
ApplicationController.new.set_current_view_context
Draper::ViewContext.current.controller.request ||= ActionController::TestRequest.new
Draper::ViewContext.current.request ||= Draper::ViewContext.current.controller.request
Draper::ViewContext.current.params ||= {}
end
end
end