Skip to content

Instantly share code, notes, and snippets.

@ojiry
Created March 16, 2012 07:18
Show Gist options
  • Save ojiry/2048993 to your computer and use it in GitHub Desktop.
Save ojiry/2048993 to your computer and use it in GitHub Desktop.
<!-- Book(id: integer, title: string, created_at: datetime, updated_at: datetime) -->
<!-- not multiple -->
<%= collection_select 'book', 'id', Book.all, 'id', 'title', { selected: "1" } %>
<!-- multiple -->
<%= collection_select 'book', 'id', Book.all, 'id', 'title', { selected: ["1", "2", "3"] }, { multiple: "multiple" } %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment