Skip to content

Commit

Permalink
changed access to named route_sets, renamed spec function
Browse files Browse the repository at this point in the history
  • Loading branch information
Kellen Presley committed Jun 27, 2010
1 parent 8c38176 commit 46a6f23
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
5 changes: 1 addition & 4 deletions picard/lib/picard/routing_engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion sample_app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
})
Expand Down
2 changes: 1 addition & 1 deletion sample_app/controllers/test_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(){
Expand Down
4 changes: 2 additions & 2 deletions sample_app/views/advanced.haml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
= message()

#odd
= odd(3)
= parity(3)
%br
= odd(4)
= parity(4)

0 comments on commit 46a6f23

Please sign in to comment.