Looks good but 1) when the "add category" link is clicked, another category drop down box is to be shown and not a text box 2) if there are multiple categories and subcategories,
a) how would Rails identify the fields? b) how would the syntax of the collective_select form element look like? essentially , arrays should be present for categories and sub categories like category_id[1] = 34, subcategory_id[1] = 19, category_id[2] = 11, subcategory_id[2] = 339, category_id[3] = 552, subcategory_id[3] = 85, how do you do that in rails? On Oct 17, 7:47 am, sameera <[email protected]> wrote: > Hi, > > just this it like this > > <div id="category"> > -- category drop down -- > </div> > <div id="subcategory"> > -- sub category drop down ------------ > </div> > <div id="addcategory"> > -- add category link ------------- > </div> > <div id="addsubcategory"> > -- add sub category link ---------- > </div> > > 1 - You load category > 2 - In change event of the category you load sub category (Ajax) > 3 - If user clicks add category link (inside addcategory div) , you do > anajaxupdater and show the user a textbox > to enter his/her category > 4- and when user clicks save, you reload category div and re-set > subcategory div (so user will be able toselecthis new category) > 5 - subcategory is also same except you load only the sub categories > > hope this helps, > > cheers > sameera > > On Oct 16, 3:32 pm, ct9a <[email protected]> wrote: > > > ah hang onhttp://railscasts.com/episodes/74-complex-forms-part-2 > > might be the answer (roughly speaking as it shows how to addform > > elements) :) > > > Will try and let you guys know. > > > Cheers :) --~--~---------~--~----~------------~-------~--~----~ 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

