Related to rails

How to have a text-field with a drop-down in a form like example if a dropdown having list of cities with the ‘other’ when clicked on it should show a text-field.

Thank you.

Take a look at the rails form helpers. The helpers related to select components will do the trick.