Saulo Brust wrote:> I''m starting in RoR, sorry if this question seems too basic.
>
> See the code below. The second parameter of the method Rails3AMF:
> IntermediateModel.new must pass ALL properties "field". How do I
> implement a loop that does this?
>
> Thanks,
>
> Saulo
>
> ----
>
> class User
> include Mongoid::Document
> include ActiveRecord::Serialization
>
> field :name, :type => String
> field :email, :type => String
> field :username, :type => String
> field :password, :type => String
>
> def to_amf options=nil
> Rails3AMF::IntermediateModel.new(self, {"name" =>
self[:name],
> "email" => self[:email], ... } )
> end
Can''t you just use Rails'' validations for this? Am I missing
something?
>
> end
Best,
--
Marnen Laibow-Koser
http://www.marnen.org
marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.