include bootstrap role attribute in rails form helper

旧巷老猫 提交于 2019-12-03 07:00:55

You need to specify it as an html option:

<%= form_for @user, html: {class: "form-horizontal", role: "form"} do |f| %>

form_for and form_tag have to be used differently:

form_for:

<%= form_for @user, html: { class: "form-horizontal", role: "form" } do |f| %>

form_tag:

<%= form_tag some_path, class: "form-horizontal", role: "form" do |f| %>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!