Skip to content

Instantly share code, notes, and snippets.

@thisivan
Created May 14, 2009 04:56
Show Gist options
  • Save thisivan/111492 to your computer and use it in GitHub Desktop.
Save thisivan/111492 to your computer and use it in GitHub Desktop.
Creating a collection_select with custom options (E.g. new company)
= form.collection_select :company_id, Company.all + |
[OpenStruct.new(:id => 'new', :name => 'New Company')], :id, :name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment