将Bootstrap表单与表的属性相关联

时间:2019-12-04 20:41:16

标签: forms model attributes

我在Rails上使用CRUD。 如何在我的视图“ new”中指示我希望表单的字段对应于Model的属性? 例如,在这里,我怎么说该字段将与文章标题相关联? :

 <div class="form-group">
  <label for="title">Title of the article</label>
  <input type="email" class="form-control" id="title" aria-describedby="emailHelp" placeholder="Title">
  <small id="emailHelp" class="form-text text-muted">At least 2 words</small>
</div>

非常感谢您。

0 个答案:

没有答案