以下に単純な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"
無駄に。