My model includes and Account with 0..n Feeds.
I have a form that contains N number of these:
<input id="feed_url" name="feed[url]"
type="hidden"
value="http://images.apple.com/main/rss/hotnews/hotnews.rss" />
<input id="feed_url" name="feed[url]"
type="hidden"
value="http://images.apple.com/main/rss/hotnews/pr.rss" />
....
When this form is posted, what is created is something like this:
{"feed"=>{"url"=>"http://images.apple.com/main/rss/hotnews/hotnews.rss"},
"commit"=>"Create",
"account"=>{"service"=>"jabber",
"action"=>"create",
"controller"=>"feeds"}
So the problem is that I''ve got an arbitrary number of
feed[url]''s that will
be posted. These will be created new, and so do not yet have any Id''s
associated with them.
I can''t figure out how to handle this situation with rails, and yet it
seems
like a common thing.
The form I''ve shown above will post something like
feed[url]=blahblah&feed[url]=otherblahthis. Under webwork (to compare) this
would automatically be converted into an ArrayList containing each separate
Entry, which could then be set onto the Account object.
(I know that I can manually make input fields that are named feed[1][url],
feed[2][url] etc. But I''d prefer to use the rails tag functions.)
Is there a way to do this under Rails?
Thank You