lib/jtable-rails/action_controller.rb in jtable-rails-0.1.2 vs lib/jtable-rails/action_controller.rb in jtable-rails-0.1.3
- old
+ new
@@ -1,8 +1,9 @@
module JTable
module ActionController
def jtable_for_json(rel, jtable_params)
jtable_params = HashWithIndifferentAccess.new(jtable_params)
- {:total_items => rel.count, :items => rel.jtable_paginate(jtable_params[:limit], jtable_params[:offset])}
+ items = rel.jtable_paginate(jtable_params[:limit], jtable_params[:offset])
+ {:total_items => rel.count, :items => items.collect(&:jtable_item)}
end
end
end
\ No newline at end of file