Closed linojon closed 12 years ago
hi, when i write my #search controller action as your examples, its ok
def search @people = Person.search(params[:search]).paginate(:page => params[:page], :per_page=>params[:per_page]) respond_with @people, :locals => { :collection => @people } end
But not when i use the decent_exposure gem,
expose(:people) { Person.search(params[:search]).paginate(:page => (params[:page] || 1), :per_page=>params[:per_page]) } expose(:person) def search respond_with people, :locals => {:collection => people} end
Looking inside application.datatables.jsonify, the first way gets instance_variables
[:@_config, :@view_renderer, :@_routes, :@people, :@_assigns, :@_controller, :@_request, :@view_flow, :@output_buffer, :@virtual_path]
but with decent_exposure, the instance_variables are
[:@_config, :@view_renderer, :@_routes, :@_resources, :@_assigns, :@_controller, :@_request, :@view_flow, :@output_buffer, :@virtual_path]
But @_resources.class is a Hash, like { :people => [array of people] } not an active relation, and never equals collection.
Please check the current version. You may set the collection or pagination counters manually.
hi, when i write my #search controller action as your examples, its ok
But not when i use the decent_exposure gem,
Looking inside application.datatables.jsonify, the first way gets instance_variables
but with decent_exposure, the instance_variables are
But @_resources.class is a Hash, like { :people => [array of people] } not an active relation, and never equals collection.