Rails: Formtastic: Select-Boxes without primary blank field

You resolve this one of two ways:

First option: In each select box, specify if there should be a blank line or not. Options are:

<%= f.input :author, :as => :select, :include_blank => false %>
<%= f.input :author, :as => :select, :include_blank => true %>
<%= f.input :author, :as => :select, :include_blank => "No author" %>

The last version displays "No Author" as the display in the drop down, but submits the value as blank.

Second Option: Set the default in the config/initializers/formtastic.rb.

# Should select fields have a blank option/prompt by default?
# Defaults to true.
Formtastic::FormBuilder.include_blank_for_select_by_default = false

By default, this is set to true and all your drop downs will have blank options in them. Set it to false, and by default they all won't.


Have you tried :include_blank => false ?

According to this (line 718) http://github.com/justinfrench/formtastic/blob/master/lib/formtastic.rb that should work.