Formtastic with Mongoid embedded_in relations
Posted
by
miah
on Stack Overflow
See other posts from Stack Overflow
or by miah
Published on 2010-12-22T07:40:07Z
Indexed on
2010/12/23
7:54 UTC
Read the original article
Hit count: 298
Is there any quick way to make a form for embeds_many-embedded_in relation? I have the following:
class Team
include Mongoid::Document
field :name, :type => String
embeds_many :players
end
class Player
include Mongoid::Document
embedded_in :team, :inverse_of => :players
field :name, :type => String
end
I want to create a form for team with embedded editing for players. Seen https://github.com/bowsersenior/formtastic_with_mongoid_tutorial but "TODO" there.
© Stack Overflow or respective owner