Skip to content

Instantly share code, notes, and snippets.

View samuelluis's full-sized avatar

Samuel Luis De La Cruz samuelluis

  • Dominican Rapublic
View GitHub Profile
@samuelluis
samuelluis / object-watch.js
Last active August 26, 2016 23:45 — forked from eligrey/object-watch.js
object.watch polyfill in ES5
if (!Object.prototype.typeof) {
Object.defineProperty(Object.prototype, "typeof", {
enumerable: false
, configurable: true
, writable: false
, value: function (Type) {
toString = Object.prototype.toString;
return toString.call(this) == toString.call(new Type());
}
});
<!-- update_city_menu.html.erb -->
<% if @state.cities.present? %>
<select id="neighborhood_field" name="search[city_field]">
<%= options_from_collection_for_select(@state.cities, :id, :name) %>
</select>
<% end %>