I want to get possibility to select several Categories for one Post with multiple select.
I have next models: Post, Category and PostCategory.
class
Tigraine almost had it, but you need to specify an additional empty hash:
<%= f.select :category_id, Category.all.collect {|x| [x.name, x.id]}, {}, :multiple => true %>