ActiveResource can be used with nested resources, provided you need to pass the parameters accordingly. ActiveResource call it as
prefix options that used with nested resource. Its a bit tricky to pass the prefix options to different methods, since methods use different approach to accept prefix params. Lets consider we have a model for Inventory like on below,
The prefix option
:store_id is passed to various method in different ways. Make sure you use the same key as you specified in the
find() method you can pass the
:params hash, as second parameter.
save() you can’t pass it as second parameter. So you need to explicitly set on the object before calling the
.update_attributes() won’t accept any second parameter, so you need to pass it with other params.