Closed aximuseng closed 4 years ago
How are you passing the view_context into your initialize method? This has been changed.
Before:
MyDatatable.new(view_context, my_arg1: arg1, my_arg2: arg2)
After:
MyDatatable.new(params, view_context: view_context, my_arg1: arg1, my_arg2: arg2)
It's passed in as an option now, not a requirement.
Yup - the basic example has this listed wrong:
I just had params
and no view_context
. I would have never figured that out. Thanks.
I was having this same issue. I fixed it by adding in the following code:
def initialize(params, opts = {})
@view = opts[:view_context]
super
end
I suppose this is now required.
Upgraded from '0.4.0' to the latest version. Now I get:
undefined method
link_to' for nil:NilClass`Basically none of my def_delegators definitions work:
def_delegators :@view, :content_tag, :link_to, :policy, :policy_scope, :action_name, :poly_parent, :controller_name, :distance_of_time
I have followed the upgrade instructions as far as I can tell. The old '0.4.0' version works fine.
Any obvious ideas?