0

Following is my code.

class PropertyDetailsController < ApplicationController
  include ActionView::Helpers

  #Action methods.
end

But the above code is throwing following error when I try to run.

Module::DelegationError (ActionView::Helpers::ControllerHelper#action_name delegated to controller.action_name, but controller is nil: 

Any Suggestions.

UPDATE Is that true if we use params and session we cant include ActionView::Helpers

Reference: http://alphahydrae.com/2013/06/rails-3-rendering-views-outside-a-controller/

4

1 回答 1

1

我相信你必须require 'action_view'

于 2017-04-05T05:21:48.347 回答