How to combine formtastic with Ajax form submission?

I would like to use formtastic instead of the standard Rails helpers for my forms, however I am currently submitting them using Ajax (c remote_form_for

). I suppose I could use the jQuery form plugin on Ajax-ify formtastic forms, but would it be the best approach?

+2


a source to share


2 answers


Yes, if you get a great form without Ajax, then subtly add extra functionality with Javascript, you have the best of both worlds. The option was remote_form_for

removed or deprecated from Rails 3, but added an option form_for ... :remote => true

that Formtastic will support when we merge into Rails 3 support (planned for 1.1).



+4


a source


If you need functionality to add and remove fields (nested forms or attributes) for your models - use cocoon gem with formtastic



+1


a source







All Articles