Twitter Bootstrap has this role attribute for forms:
<form role="form">
How can I include the role attribute in Rails form helpers? I tried this, but it doesn't work:
<%= form_for @user, class: "form-horizontal", role: "form" do |f| %>
Twitter Bootstrap has this role attribute for forms:
<form role="form">
How can I include the role attribute in Rails form helpers? I tried this, but it doesn't work:
<%= form_for @user, class: "form-horizontal", role: "form" do |f| %>
You need to specify it as an html option:
<%= form_for @user, html: {class: "form-horizontal", role: "form"} do |f| %>
<%= form_for(@user), ...
-- It yields syntax error, unexpected tLABEL
and syntax error, unexpected keyword_do_block, expecting keyword_end
. –
Cherianne @user
object. –
Monograph 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| %>
© 2022 - 2024 — McMap. All rights reserved.