Skip to content

Instantly share code, notes, and snippets.

@ianhenrysmith
Created January 21, 2013 16:10
Show Gist options
  • Select an option

  • Save ianhenrysmith/4587104 to your computer and use it in GitHub Desktop.

Select an option

Save ianhenrysmith/4587104 to your computer and use it in GitHub Desktop.
Bootstrap hamlc dropdown helper
.dropdown{ class: @options.class }
%input.dropdown_target{ type: "text", name: @field, id: @field, value:"#{@value}"}
%span.dropdown-toggle= @value
%ul.dropdown-menu{ role:"menu"}
- for opt in @values
%li.dropdown_item{v: opt}= opt
- vs = $("#values").val().split(" ")
!= @h.dropdown({values: vs, field: "type", value: @model.type, options: {}})
Once.Views.Posts ||= {}
class Posts.BaseView extends Backbone.View
helpers:
dropdown: (options={}) =>
JST['backbone/templates/shared/dropdown'](options)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment