How to do optgroups?

I was palying around with the form field functions in rails and couldn’t
figure out a way to do an optgroup, which is a way to group options in a
select field.

Any ideas how to do this?

Thanks.

http://api.rubyonrails.com/classes/ActionView/Helpers/FormOptionsHelper.html#M000405

http://api.rubyonrails.com/classes/ActionView/Helpers/
FormOptionsHelper.html#M000405

The API docs are very unclear, with very little information. I think
the original poster would like a real example on how to use it.

Best regards

Peter De Berdt

Peter De Berdt wrote:

http://api.rubyonrails.com/classes/ActionView/Helpers/
FormOptionsHelper.html#M000405

The API docs are very unclear, with very little information. I think
the original poster would like a real example on how to use it.

Best regards

Peter De Berdt

I agree, and the only optgroup function there is for a collection.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs