README.rdoc in activeresource-response-0.0.6 vs README.rdoc in activeresource-response-0.0.7
- old
+ new
@@ -8,24 +8,31 @@
Such functionallity can be used for easily implementing pagination in a REST API so that an ActiveResource client can navigate paginated results.
== How to use?
Add dependency to your Gemfile
- gem "activeresource-response", "~> 0.0.5"
+ gem "activeresource-response", "~> 0.0.7"
-Just open your ActiveResource class and add
+Just open your ActiveResource class and add
add_response_method :your_method_name
+You can add method to ActiveResource::Base to use it in all subclasses
+
+ class ActiveResource::Base
+ add_response_method :my_response
+ end
+
+
== Full example of usage with kaminari gem
Rest Client
class Order < ActiveResource::Base
self.format = :json
self.site = 'http://0.0.0.0:3000/'
self.element_name = "order"
- add_response_method :http_response # our new method
+ add_response_method :http_response # our new method for returned objects
end
Server Side
class OrdersController < ApplicationController
\ No newline at end of file