Formtastic和simple_form如何比较?

时间:2022-12-26 19:16:29

How do Formtastic and simple_form compare? What the benefits of each ?

Formtastic和simple_form如何比较?它们有什么好处?

2 个解决方案

#1


62  

Formtastic and simple_form are very similar, the usage is also very similar.

Formtastic和simple_form非常相似,用法也非常相似。

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.

主要的区别是formtastic的标记是固定的。请注意:如果你不介意的话,那真是太棒了。刚开始真的很棒。它还提供了一个默认的css,所以你的表单会直接显示出来。

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.

simple_form优于formtastic的优点是可以根据需要修改标记。如果您的设计人员希望您的字段分组在div而不是li中,这将非常方便。simple_form的缺点是它不附带任何标准布局(css)。这使得formtastic更容易开始。因为API几乎是相同的,如果需要,您可以很容易地切换到simple_form。

[UPDATE 22-6-2015] Actually, currently simple-form supports bootstrap out of the box, so for me personally I always prefer simple-form now.

[更新22-6-2015]实际上,目前简单的表单支持从框中启动,所以对于我个人来说,我现在更喜欢简单的表单。

#2


7  

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:

目前,使用Twitter Bootstrap 3的simple_form很麻烦。但是它在BS2中很有效。Formtastic和BS3通过模板-bootstrap gem非常有效:

gem 'bootstrap-sass', '~> 3.0.3.0'

宝石的bootstrap-sass”、“~ > 3.0.3.0 '

gem 'formtastic-bootstrap', git: 'https://github.com/mjbellantoni/formtastic-bootstrap.git', branch: :bootstrap3_and_rails4

gem ' formtas- bootstrap', git: ' https://github.com/mjbellantoni/formtas- bootstrap.git', branch: bootstrap3_and_rails4

Unfortunately, Formtastic does not handle rails g scaffold; simple_form does.

不幸的是,Formtastic不能处理rails g脚手架;simple_form。

#1


62  

Formtastic and simple_form are very similar, the usage is also very similar.

Formtastic和simple_form非常相似,用法也非常相似。

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.

主要的区别是formtastic的标记是固定的。请注意:如果你不介意的话,那真是太棒了。刚开始真的很棒。它还提供了一个默认的css,所以你的表单会直接显示出来。

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.

simple_form优于formtastic的优点是可以根据需要修改标记。如果您的设计人员希望您的字段分组在div而不是li中,这将非常方便。simple_form的缺点是它不附带任何标准布局(css)。这使得formtastic更容易开始。因为API几乎是相同的,如果需要,您可以很容易地切换到simple_form。

[UPDATE 22-6-2015] Actually, currently simple-form supports bootstrap out of the box, so for me personally I always prefer simple-form now.

[更新22-6-2015]实际上,目前简单的表单支持从框中启动,所以对于我个人来说,我现在更喜欢简单的表单。

#2


7  

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:

目前,使用Twitter Bootstrap 3的simple_form很麻烦。但是它在BS2中很有效。Formtastic和BS3通过模板-bootstrap gem非常有效:

gem 'bootstrap-sass', '~> 3.0.3.0'

宝石的bootstrap-sass”、“~ > 3.0.3.0 '

gem 'formtastic-bootstrap', git: 'https://github.com/mjbellantoni/formtastic-bootstrap.git', branch: :bootstrap3_and_rails4

gem ' formtas- bootstrap', git: ' https://github.com/mjbellantoni/formtas- bootstrap.git', branch: bootstrap3_and_rails4

Unfortunately, Formtastic does not handle rails g scaffold; simple_form does.

不幸的是,Formtastic不能处理rails g脚手架;simple_form。