Skip to content

Instantly share code, notes, and snippets.

View Chandler's full-sized avatar

Chandler Abraham Chandler

View GitHub Profile
when I visit /orgs/17 via a full refresh everything works as expected.
The page shows me some info about org 17 that is loaded from the server.
When I'm on the index page and I link to /org/17 using linkTo, the model isn't loaded..there's no org data on the page.
#index handlebars template
{{#linkTo organizations.show id class="org-name"}} {{name}} {{/linkTo}}
#router
#config
config defaultToCurrentScreen true
config nudgePercentOf screenSize
config resizePercentOf screenSize
#resize
bind right:ctrl push right bar-resize:screenSizeX/2
bind left:ctrl push left bar-resize:screenSizeX/2
bind up:ctrl push up bar-resize:screenSizeY/2
bind down:ctrl push down bar-resize:screenSizeY/2
#when I visit /orgs/5, my route's model method isn't called with the dynamic segment.
Broken:
App.Router.map ->
@resource 'organizations', path: "/orgs", ->
@resource 'organization', path: ":id", ->
App.OrganizationIndexRoute = Ember.Route.extend
model: (params) ->
console.log(params)
# This is the default .slate file.
# If no ~/.slate file exists this is the file that will be used.
#config
config defaultToCurrentScreen true
config nudgePercentOf screenSize
config resizePercentOf screenSize
#resize
bind right:ctrl push right bar-resize:screenSizeX/2
(function($){
/* router */
var AppRouter = Backbone.Router.extend({
routes: {
"": "home",
}
});
var app_router = new AppRouter;
app_router.on('route:home', function( id ){
var express = require('express')
, http = require('http');
var app = express();
var server = app.listen(8080, '127.0.0.1');
var io = require('socket.io').listen(server);
app.configure(function(){
app.use(express.static(__dirname + '/public'));
})
$(".encrypted-content").show()
$(".encrypted-content").html(function(index, oldtext){
new_string = ""
/*handle special html characters */
oldtext = oldtext.replace(/>/g,">");
oldtext = oldtext.replace(/&lt;/g,"<");
oldtext = oldtext.replace(/&amp;/g,"&");