:radio with multiple value options? (Non-association) #18

ariejan opened this Issue Jun 7, 2009 · 1 comment


None yet
2 participants

ariejan commented Jun 7, 2009

I have an attr_accessor on my model that should contain one of three values. How do I code this? Doing three :as => :radio elements just creates three yes/no fields, which is not what I want.

Maybe this is a feature request, maybe I'm just too tired to find the right docs.


justinfrench commented Jun 22, 2009

Hi, to do this you would need one :radio input, and you would need to supply a :collection option to it which can be an Array of objects, or perhaps in your case, an Array of Strings:

f.input :foo. :as => :select, :collection => ['cat', 'dog', 'mouse']

This should be in the rdoc documentation, but isn't, so I'll create a new issue for that.

This issue was closed.

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