Socket
Book a DemoInstallSign in
Socket

ooorest

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ooorest

0.0.5
bundlerRubygems
Version published
Maintainers
1
Created
Source

OOOREST - OpenObject On Rails, REST layer

BY OOOR stands for OpenObject On Rails. OpenObject is the RAD framework behind OpenERP, the ERP that doesn't hurt, just like Rails is "web development that doesn't hurt". So OOOR exposes seamlessly your OpenOpbject application, to your custom Rails application. Needless to say, OOOR doubly doesn't hurt. Furthermore, OOOR only depends on the "activeresource" gem. So it can even be used in any (J)Ruby application without Rails.

OooREST enables REST HTTP routes to your OpenERP models: Before anything, make sure you read the doc of OOOR Install the gem using gem install ooorest.

we assume you created a working Rails application, in your config/environment.rb Inside the Rails::Initializer.run do |config| statement, paste the following gem dependency (along with the ooor dependency):

$ config.gem "ooorest"

in your config/route.rb, you can alternatively enable routes to all your OpenERP models by addding: $ OOOREST.load_all_controllers(map)

Or only enable the route to some specific model instead (here partners): $ map.resources :res_partner

REST HTTP API:

$ http://localhost:3000/res_partner
$ http://localhost:3000/res_partner.xml
$ http://localhost:3000/res_partner.json
$ http://localhost:3000/res_partner/2
$ http://localhost:3000/res_partner/2.json
$ http://localhost:3000/res_partner/2.xml
$ http://localhost:3000/res_partner/[2,3,4].xml
$ http://localhost:3000/res_partner/[2,3,4].json

$ TODO http://localhost:3000/res_partner.xml?active=1

$ TODO http://localhost:3000/res_partner.xml?domain=TODO

FAQ

Can I extend the OOOR controllers?

Yes, you can do that, see the "how to extends models" section as it's very similar. Instead, in the app/controllers directory, you'll re-open defined controllers, for the product.product controllers, it means creating a product_product_controller.rb file with:

$ class ProductProduct < OpenObjectsController
$   def foo
$     render :text => "bar"
$   end
$ end

Now, if you register that new method in your route.rb file GET /product_product/1/foo will render "bar" on your browser screen. You could instead just customize the existing CRUD methods so you don't need to regiter any other route in route.rb.

FAQs

Package last updated on 19 Jan 2010

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.