ruby - view_context equivalent in Rails 2.3 -
looking through railscast 340, datatables/will_paginate, example uses view_context when initiating new instance.
def index respond_to |format| format.html format.json { render json: productsdatatable.new(view_context) } end end
i've tried same code realize rails 2.3 not have it.
according docs, equivalent is
view.new[lookup_context, assigns, controller]
what lookup_context , assigns refer to? i've tried following.
user.new(current_program.users, {}, self)
however, expected, if pass above in, throw unexpected error 3 1.
Comments
Post a Comment