About this article
A user registration function is implemented during the production of my own matching app. Among them, if the item of "age" can be implemented by pull-down instead of hand-made I thought it would be good if UX could be improved. When I looked it up, it was so easy to implement that I will post it as a memorandum!
[environment] ・ Ruby 2.6.5 Rails 6.0.0 ・ MacOS
It is assumed that the user management function has already been installed using the "device" gem.
app > views > devise > registrations > new.html.erb
Originally, it was described as follows for implementation by hand.
<%= f.text_field :age, autocomplete: "off" %>
Let's change it from "text" to "number"!
<%= f.number_field :age, autocomplete: "off" %>
It was easy to implement!