I am coding an application that keeps track of request to create
college courses. An identified user (logically a faculty member)
completes a form indicating the name of the course, the professor in
charge, the course’s code, the date and place, the possible
coprofessors and TAs and the type of website he or she wants to use as
a teaching help (WebCT, Sakai, etc.).
I have two problems about what I’m doing.
First of all, we can have from 0 to inf coprofessors and TAs.
Therefore I need to be able to add fields to my form dynamically. I
and books about Rails tend to tell me to use AJAX and partials. I feel
it’s plain stupid to recontact the server just to add a blank <input /
disabled. Should I use a plain HTML version only that uses one form to
add TAs or coprofessors one at a time?
Second I’m not sure if my usage of form_for and fields_for is the
wisest one. For now, I have one big form (still OK to use I feel) with
infos about TAs, coprofessors, periods, places, etc. all in one place.
In the back-end of course they are different models so I use a
form_for Course and several fields_for (in partials). Should I instead
separate it in several pages/views with form_fors in each of them?
What the “Railser” way to do it?
Thank you for your help and time!