Dynamic form fields in Rails3 with jquery

前端 未结 2 843
野趣味
野趣味 2021-02-06 19:31

I am using rialscasts #74 as a guide.

I am trying to dynamically add form fields via a text-link. In the railscast episode he achieves it very nicely using the followin

2条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-06 19:52

    The current RailsCasts/ASCIICasts are #196 (see http://asciicasts.com/episodes/196-nested-model-form-part-1) & 197 which have been updated for Rails3.

    Ryan Bates has also created a gem called nested_form (see https://github.com/ryanb/nested_form) which handles much of this for you. He has has also created examples of complex nested forms using Prototype, jQuery, and his nested form gem; you can find a link on the nested_forms page.

    Good stuff!

提交回复
热议问题