Don't write the sample_resource.rb, try if the default behavior works.
Study and user should expose as well the uuid.
Basically , embedded resource should use exactly the same JSON as the resource seen on its own.
If we want to "collapse" we'll use a different mime type.

Max

On Jan 17, 2013, at 2:22 PM, llh1 <notifications@github.com> wrote:

> In lib/lims-api/resource.rb:
> 
> > @@ -94,6 +94,8 @@ def hash_to_stream(s, hash, mime_type)
> >              resource = @context.resource_for(v,@context.find_model_name(v.class))
> >              s.with_hash do
> >                resource.encoder_for([mime_type]).actions_to_stream(s)
> So shall i write the sample_resource.rb to encode the resource? 
> Actually, it's the same bits of code for the study and the user in an order (except that the code is in the order_resource.rb)
> 
> —
> Reply to this email directly or view it on GitHub.
> 
>