Change id in simple form Change id in simple form ruby-on-rails ruby-on-rails

Change id in simple form


Specify the id within the html option:

= simple_form_for @account, url: account_url, wrapper: :inline, html: { method: :put, id: :edit_account } do |f|


The question is ambiguous, so note that if you are trying to change the id of an element in the form rather than the id of the whole form, then you should use input_html: { id: :select_special }.