Why is the first element always blank in my Rails multi-select, using an embedded array?

In Rails 4: You will be able to pass :include_hidden option. https://github.com/rails/rails/pull/5414/files As a quick fix for now: you can use right now in your model: before_validation do |model| model.subset_array.reject!(&:blank?) if model.subset_array end This will just delete all blank values at model level.

How to get multiple select box values using jQuery?

Using the .val() function on a multi-select list will return an array of the selected values: var selectedValues = $(‘#multipleSelect’).val(); and in your html: <select id=”multipleSelect” multiple=”multiple”> <option value=”1″>Text 1</option> <option value=”2″>Text 2</option> <option value=”3″>Text 3</option> </select>

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)