Skip to content

Instantly share code, notes, and snippets.

function post(args) {
//DO post here
}
function comment() {
//Do comment here
}
function checkUser(args) {
//Check args here to make sue is user
@jonathanKingston
jonathanKingston / gist:2501225
Created April 26, 2012 17:42
rendering of diff templates
Handlebars.registerHelper('content', function(something) {
if(something) {
Meteor.ui.chunk(function() {Template.hello({first: "Alyssa", last: "Hacker"});});
} else {
Meteor.ui.chunk(function() {Template.something_else({first: "silly", last: "bobby"});});
}
});
@jonathanKingston
jonathanKingston / routerissue2
Created April 22, 2012 00:03
sample route issue
BrittoRouter = Backbone.Router.extend({
routes: {
":slug": "findPost",
":slug/": "findPost"
},
findPost: function(slug) {
console.log(Posts.find());
console.log(Posts.findOne());
post = Posts.findOne({slug: 'out'});
Session.set('new_slug', slug);
BrittoRouter = Backbone.Router.extend({
routes: {
":slug/": "findPost",
},
findPost: function(slug) {
alert(slug);
}
});
Router = BrittoRouter();