Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

creating inputs with a string method instead of symbol and I18n #838

HoneyryderChuck opened this Issue Apr 12, 2012 · 3 comments


None yet
2 participants


I'm not very fond of the first argument of the input function called on the builder being mandatorily a symbol. Now, let's say, I have a string array of attributes from the form object, and i want to generate an input field for them, I have to make them a symbol first, otherwise the label translation will not be loaded. This represents a breach of logic from the previous version and the rails formtag helpers, which still accept the method as being a string. Why can't we defined the optional label as an option sent in the options hash of the call, as we used to do in the rails 2 version (I guess that works still)?

So, the exact problem is, when I call:

f.input "pron", :as => :select, :collection ....

the label from the element will be "pron", and not "Prontastic", which is the translation I have for it under formtastic.labels.pron. I've changed it since then to a symbol and the translation is correctly loaded.


justinfrench commented Apr 12, 2012

@tiagocardoso1983 This was not a deliberate regression, although Formtastic has never intentionally supported or documented strings instead of symbols. What previous version of Formtastic did this work for you? This will help me narrow down the change and understand it.

Hey justinfrench,

The version where that was working was the 1.2.4 .


justinfrench commented Jun 6, 2012

This is merged in a nd will be in 2.2.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment