I would like to use formtastic instead of standard Rails 开发者_开发知识库helpers for my forms, however I currently submit them using Ajax (with remote_form_for
). I suppose I could use the jQuery form plugin to Ajax-ify formtastic forms, but would it be the best approach?
Yes, if you get your form working great without Ajax, then apply the extra functionality unobtrusively with Javascript, you'll have the best of both worlds. The remote_form_for
option is removed or deprecated from Rails 3, but they have added a form_for ... :remote => true
option which Formtastic will support when we merge in Rails 3 support (planned for 1.1).
If you need add and remove fields (nested forms or attributes) functionality for you models — use cocoon gem with formtastic
精彩评论