How do Formtastic and simple_form compare?
How do Formtastic and simple_form compare? What are the pros and cons of each?
Formtastic and simple_form are very similar, the usage is also very similar.
The main difference is that the markup of formtastic
is fixed. Mind you: if you don't mind, it is fantastic. It is really awesome to get started with. Also it comes with a default css, so your forms will look good straight out of the box.
The advantage of simple_form
over formtastic
is that you can modify the markup to your needs. This can be handy if your designer likes your fields to be grouped inside div instead of li. The downside of simple_form
is that it doesn't come with any standard layout (css). That makes formtastic much easier to start off with. Because the API is nearly identical, if needed, you can very easily switch to simple_form
if needed.
[UPDATE 22-6-2015] Actually, currently simple-form supports bootstrap out of the box, so for me personally I always prefer simple-form now.
[UPDATE 29-07-2014] simple_form added an option of being compatible with ZURB Foundation forms.
At the moment, simple_form with Twitter Bootstrap 3 is a pain. But it works very well with BS2. Formtastic and BS3 work very well through the formtastic-bootstrap
gem:
gem 'bootstrap-sass', '~> 3.0.3.0'
gem 'formtastic-bootstrap', git: 'https://github.com/mjbellantoni/formtastic-bootstrap.git', branch: :bootstrap3_and_rails4
Unfortunately, Formtastic does not handle rails g scaffold
; simple_form does.