   return unless selectOptions?.length > 0
 
   settings = _.defaults options.hash,
-    placeholder: ''
-    className: ''
-    label: null
-    tabindex: ''
-    valueKey: 'value'
+    className: 'form-control'
+    valueKey: '_id'
     nameKey: 'name'
 
-  o = []
-  o.push createLabel settings.label, name if settings.label
-  o.push """<select name="#{name}">"""
+  settings.selected = 'selected' if value
+
+  optionEls = []
   for opt in selectOptions
-    isSelected = if opt[settings.valueKey] is value
-      "selected"
-    else
-      ""
+    optionEls.push tag 'option',
+      value: opt[settings.valueKey]
+      selected: if opt[settings.valueKey] is value
+        "selected"
+      else
+        ""
+    , opt[settings.nameKey]
 
-    o.push tag 'option',
-      value: opt[settings.valueKey]
-      selected: isSelected
-    , opt[settings.nameKey]
-  o.push "</select>"
-
-  new Handlebars.SafeString o.join ''
+  wrap tag('select',
+    className: settings.className
+    tabindex: settings.tabindex
+    name: name
+  , optionEls.join ''), settings.label

createLabel = (text, name) ->
  tag 'label',
    for: "input-#{name}"
  , text

wrap = (content) ->
  tag 'div', class: 'form-group', content

tag = (el, attrs={}, content='', options={}) ->

    _.extend params,
      'data-sluggify': options.hash.sluggify

  wrap tag('input', params, false, selfClosing: true), settings.label

Handlebars.registerHelper 'textarea', (name, value, options) ->
  settings = options.hash

  textarea = tag 'textarea',
    name: name
    className: settings.className || 'form-control'
    id: "input-#{name}"
    placeholder: settings.placeholder
    tabindex: settings.tabindex
    rows: settings.rows
  , value

  wrap textarea, settings.label if settings.label


Handlebars.registerHelper 'submit', (text, options) ->
