我在下面有简单的 simple_form。我正在尝试将输入字段的 ID 设为“my-id”,但下面的解决方案不起作用(id 为“comment_body”)。如何为该输入字段指定 id?
= simple_form_for(@comment) do |f|
= f.input :body, as: :string, html: {id: "my-id"}
= f.button :submit
我也试过
= f.input :body, as: :string, id: "my-id"
无济于事。