I have the following modal form from example:
You can do: e.g
<%= f.text_field :first_name, class: "form-control", placeholder: "Enter first name", autofocus: true%>
just add this: autofocus: true