似乎无法找到这个问题的答案 - 向 rails form_for 中的元素添加样式或类样式的 haml 语法是什么?
我正在处理的代码是
.row.form
.threecol
.sevencol
= form_for @article do |a|
%h3= a.label "title"
= a.text_field :title
%h3= a.label "description"
= a.text_area :description
%h3= a.label "body"
= a.text_area :body
%br/
= a.submit "Post Article"
.twocol.last
我想为文本区域描述元素添加样式。我已经尝试过(其中 new_desc 是类样式)
= a.text_area.new_desc :description
和
= a.text_area { :style ... } :description
但两者都未能编译。任何人都可以帮助解决这个(希望是微不足道的)问题吗?