I have an object @person and I need to save it locally and send the same
object with Active Resource to a Restfull server...
My solution to this is to define a @person.new(params[:person]) and a RestFullPerson hooked on
ActiveResource::Base
the problem is when I do a save of the Restfull person it need a hash
structure
so I can't do the following:
result = RestfullPerson.new(@person)
I can't get any to_hash methods to work. any ideas are welcome
I have an object @person and I need to save it locally and send the
same
object with Active Resource to a Restfull server...
My solution to this is to define a @person.new(params[:person]) and a RestFullPerson hooked on
ActiveResource::Base
the problem is when I do a save of the Restfull person it need a hash
structure
so I can't do the following:
result = RestfullPerson.new(@person)
I can't get any to_hash methods to work. any ideas are welcome
I'm not 100% sure i've understood your question, but is @person.attributes what you're after ?