Manually set the ID's of form input fields in a simpleform form?

前端 未结 2 1944
攒了一身酷
攒了一身酷 2021-01-14 23:11

Is it possible to overrule simpleform\'s naming of textfields within a form?

This:

= f.input_field :age_from,

Outputs in:



        
2条回答
  •  梦谈多话
    2021-01-14 23:17

    Like your other question html options should be passed in input_html hash in simple_form:

    <%= f.input :age_from, ..., :input_html => { :id => 'my_id' } %> should work.
    

提交回复
热议问题