Skip to content

Instantly share code, notes, and snippets.

View themeteorchef's full-sized avatar

The Meteor Chef themeteorchef

View GitHub Profile
@themeteorchef
themeteorchef / list-template.html
Last active April 14, 2025 18:01
Select item select box that matches the passed value.
<template name="example">
<select class="form-control" name="select">
{{#each teams}}
<!--
Here, ../team (../ is a Handlebars convention for traversing template scope) allows us to get the team
value from the parent template (i.e. {{team}}). this._id allows us to get the _id value of the current
item being iterated, or in this example, the _id of the current team. Our UI helper matches the current
team against the current option, if they match, that option is displayed as selected in the select box.
-->
<option {{selectOption ../team this._id}} value="{{_id}}">{{name}}</option>
@themeteorchef
themeteorchef / client-signup.coffee
Last active November 29, 2016 12:21
Create user accounts that automatically login without using Accounts.createUser on the client.
Template.signup.events(
'submit form': (e,t) ->
# Prevent form from submitting.
e.preventDefault()
# Grab the user's details.
user =
email: t.find('[name="emailAddress"]').value
password: t.find('[name="password"]').value