Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

changed access to named route_sets, renamed spec function

  • Loading branch information...
commit 46a6f23df36c93704baa1e0fe287bae5458593eb 1 parent 8c38176
Kellen Presley authored
View
5 picard/lib/picard/routing_engine.js
@@ -107,10 +107,7 @@ GLOBAL.route_set = function(name, handler){
route_set_cache[name] = route_set_scope
handler.apply(route_set_scope)
}
-}
-
-GLOBAL.route_sets = function(){
- return route_set_cache
+ return route_set_cache[name]
}
Picard.routes = routes
View
2  sample_app/app.js
@@ -34,7 +34,7 @@ helpers({
message: function(){
return "Welcome to Picard!"
},
- odd: function(num){
+ parity: function(num){
return num + (num % 2 == 0 ? " is even" : " is odd")
}
})
View
2  sample_app/controllers/test_controller.js
@@ -4,7 +4,7 @@ route_set(function(){ // no name given
message: function(name){
return 'Hello ' + (name ? name : '')
},
- version: route_sets().operations.helpers().version
+ version: route_set('operations').helpers().version
})
this.get('/anonymous_route_set', function(){
View
4 sample_app/views/advanced.haml
@@ -15,6 +15,6 @@
= message()
#odd
- = odd(3)
+ = parity(3)
%br
- = odd(4)
+ = parity(4)
Please sign in to comment.
Something went wrong with that request. Please try again.