backbone.js - Chaplin router optional parameters -


i working on chaplinjs (backbone framework). following route.js code block.

return function(match) {             match(':customer/getcardsnavsummary', {controller:'customer', action:'showplan'});     match(':customer/getcardsnavsummary/:plan/:row', {controller:'customer', action:'showplan'}); }; 

instead, want following

return function(match) {         match(':customer/getcardsnavsummary(/:plan/:row)', {controller:'customer', action:'showplan'});     }; 

this works foe backbone. went through routing code rails also, , there works. when comes chaplinjs don't !

in chaplinjs doc did not find thing related router optional parameters.

chaplin.router not extend backbone.router. far know, trying achieve not possible chaplin.router.

as desired endpoint same both routes (customer:showplan), 1 possible workaround use constraints option regexp matches both getcardsnavsummary , getcardsnavsummary-plan-row pattern , then, in controller, check , parse endpoint needed.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -