Che, Luis, me salvaste. Vi el link ese mientras buscaba, y no le di bola. No
se porque... :/

En fin, funcionó perfecto, haciendo asi:

user = External::User.new( :login => 'usuario03', :email => '
[EMAIL PROTECTED]', :password => '123456', :password_confirmation =>
'123456', *:consumer_id => 1*  )
user.save

Parece ser que ActiveResource mira la lista de atributos y lo reemplaza en
la url que se especifica en la url del modelo. Muy bueno, pero documentado
en ningun lado... :/

Gracias, Luis... ya estaba re quemado! Me destrabaste...

Lucas

2008/5/10 Luis Lavena <[EMAIL PROTECTED]>:

> 2008/5/10 Lucas Florio <[EMAIL PROTECTED]>:
> > Buenas, tengo una pregunta para realizar:
> >
> > Tengo dos modelos ActiveResource, anidados y encuentro la forma de crear
> un
> > Usuario (que depende de consumer).
> >
>
> Ahh, anidaciones! :-P
>
> Por lo general yo prefiero eludir las anidaciones para ActiveResource,
> pero ya que podes necesitarlo...
>
> Probaste:
>
> user = External::User.new(:consumer_id => consumer.id)
>
> ?
>
> Sacado de aqui:
>
> (Nested Model Initialization)
>
> http://whynotwiki.com/ActiveResource
>
> Espero te sirva.
> --
> Luis Lavena
> AREA 17
> -
> Human beings, who are almost unique in having the ability to learn from
> the experience of others, are also remarkable for their apparent
> disinclination to do so.
> Douglas Adams
> _______________________________________________
> Ruby mailing list
> [email protected]
> http://lista.rubyargentina.com.ar/listinfo.cgi/ruby-rubyargentina.com.ar
>



-- 
Lucas Florio
Developer
----
Nora Ephron
"Insane people are always sure that they are fine. It is only the sane
people who are willing to admit that they are crazy."
_______________________________________________
Ruby mailing list
[email protected]
http://lista.rubyargentina.com.ar/listinfo.cgi/ruby-rubyargentina.com.ar

Responder a