1

I need to create an interface in rails which may not work directly with activeresource.

How would I create a model that uses rest-client to talk to the api directly?

Would it be better for me to keep using active resource but override the default behaviour, and how would I do that?

Joseph Le Brech
  • 6,541
  • 11
  • 49
  • 84

1 Answers1

0

I once made a Rails app which used a Java graph database (neo4j) which provides a REST api for CRUD operations (basically). I used the HTTParty gem and, for example, instead of the create method of a controller calling ActiveRecord, it called the REST api which returned JSON.

carpamon
  • 6,515
  • 3
  • 38
  • 51
  • I didn't need Rails models for my graph database objects, but you can consider building them by parsing the REST response (performance will be affected) – carpamon Feb 10 '12 at 16:05
  • i'm looking at rest_client in the controllers only now. I think the models look like too much overhead. – Joseph Le Brech Feb 10 '12 at 16:11