Using ActiveResource without Rails

2019-07-15 01:40发布

问题:

Hi I'm developing a Rails application that exposes some methods via ActiveResource. I want to access these resources through a simple remote ruby script. I want to know if it's possible use ActiveResource without Rails .

回答1:

Indeed you can. ActiveResource is a separate library. However, ActiveResource depends on ActiveSupport, so make sure you include both as requirements in your code.



回答2:

Yes it's possible to use ActiveResource separately.

You can find good documentation on the project page @ github.



回答3:

Yes, I've done it before. But IMO, there are other options out there now that are a little nicer. RestClient and HTTParty come to mind.