I’m using the technique Ryan Bates illustrated in Railscasts Episode 197 so that the form can “grow” as the user adds more items to the form. That’s all working great, but I need to call the page while supplying an initial item as a part of the URL.
Since Ryan’s technique has the user click an Add button to invoke a jQuery function to add fields to the form, I’m a little stymied how to pass information from the controller to jQuery to invoke — and prefill — one of those new fields.
Am I thinking about this wrong?
Yes, you’re thinking about it wrong 😉
Take this form for example:
fields_foris an iterator; so all your controller has to do is:and it will show up on the page.