Side effect in simple_form can break phone number input on iphone
We use (and love) the simple_form 2.0 gem in rails 3 apps, but discovered one undesirable side effect of some of the automagic mapping they do.
Problem: If you have a field on your webpage named “phone” and your app is letting people input their phone number as a flexible string such as “Office (555) 555-5555 ext 123″ the user is screwed on an iphone because it will be a ‘phone-keys-only keyboard’ with NO way to type alpha chars.
Reason: The reason is that the simple_form DSL adds the class ‘tel’ to the input field if the field name is named ‘phone’, and on the iphone that prevents any alpha input.
Workaround: The fix is simple, add “:as => :string” to your “f.input :phone” statement and the simple_form gem will assign a class ‘string’ instead of ‘tel’.