randombits
randombits

Reputation: 48450

Why is this not creating a multi-select box in a Rails form?

The code is straight forward.

<%= f.select(:categories, options_for_select(@categories), {:multiple => true, :size => 10}) %><br />

This is creating a single select box. Not one where multiple ones can be selected. Rails 3.1.3.

Upvotes: 1

Views: 672

Answers (1)

Andrew Cetinic
Andrew Cetinic

Reputation: 2835

:multiple is a html_option

<%= f.select(:categories, options_for_select(@categories), {}, {:multiple => true, :size => 10}) %><br />

Upvotes: 4

Related Questions