且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用 Rails 4 添加字段以设计注册

更新时间:2023-12-01 13:24:28

使用f.something",您可以只定义表单中的字段类型.尝试类似

With "f.something" you can just define the type of the field in the form. Try something like

<%= f.text_field :lastName %>

这应该可行.

您可以在此处阅读有关可用字段类型的信息:http://apidock.com/rails/ActionView/Helpers/FormHelper/form_for

You can read about the available types of fields here: http://apidock.com/rails/ActionView/Helpers/FormHelper/form_for