Search code examples
ruby-on-railssimple-form

What benefits does simple_form provide when used without a model?


The answers in SimpleForm without for (non model form) indicate that it's possible to create a form using SimpleForm without a model being used.

However, I don't know whether it makes sense to do so.

What benefits does SimpleForm provide over the forms generated by Rails when you don't have a model object involved?


Solution

  • The benefit that it provides is that you don't have to build any html around your fields, and add classes to them, if you properly configured simple_form. Because for example for bootstrap you mostly will have some wrappers around your inputs.

    And you also have automatic error messages in your form this way.