This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Monkey patch to instrument Moped 1.x same as 2.x. | |
# Can be removed after upgrading to Mongoid 4. | |
module Moped | |
module Instrumentable | |
class Noop | |
class << self | |
# Do not instrument anything. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.resource("posts", { path: "/posts" }, function() { | |
this.resource("show", { path: "/:post_id" }); | |
}); | |
this.resource("posts", { path: "/posts" }, function() { | |
this.resource("post", { path: "/:post_id" }); | |
}); | |
this.resource("posts", { path: "/posts" }); | |
this.resource("post", { path: "/posts/:post_id" }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source :rubygems | |
gem 'rack-rewrite' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SC.routes.currentLocationDidChange = function(){ | |
this.set('location', this.get('currentLocation')); | |
}; | |
SC.routes.addObserver('currentLocation', SC.routes, 'currentLocationDidChange'); | |
SC.routes.locationDidChange = function(){ | |
var location = this.get('location'), | |
current = this.get('currentLocation'); | |
if (location !== current) { | |
this.trigger(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MyApp.MyModel.mixin({ | |
resourcePathFor: function(action, storeKey, item) { | |
var id, path; | |
id = storeKey ? MyApp.store.idFor(storeKey) : null; | |
switch(action) { | |
case 'fetch': | |
case 'create': | |
path = 'items'; |