calebhearth / formulaic

Simplify form filling with Capybara
MIT License
552 stars 29 forks source link

Try translating option for select in StringInput #52

Closed hovsater closed 8 years ago

hovsater commented 8 years ago

This will try translating the given option as defined by simple_form and fallback to the actual value if no translation is found. If no option is found matching the given value a more useful error will be raised telling the user an option matching the given input was not found.

For now, I've only implemented this for StringInput. I'm aware we have other input classes working with select elements that also would benefit from this change. I'd love to discuss how we implement this nicely so all relevant input classes can benefit from this change.

/cc @calebthompson

hovsater commented 8 years ago

@calebthompson updated as per your comment. :smile: