Mikko Lipasti
2008-12-02 09:45:52 UTC
Hello list,
I'm having problems figuring out how to work with the Dispatcher.
This is what I have in the Dispatcher:
under [ 'blog', 'wiki' ] => [
run {
default model => "MyApp::Model::\u$1";
},
on 'search' => run {
set op => 'search';
},
];
on '**' => show 'dump'; # prints out whats in %ARGS
This is what I expect:
/blog/search: model => 'MyApp::Model::Blog', op => 'search'
/wiki/search: model => 'MyApp::Model::Wiki', op => 'search'
However, what I get is dependant upon the order in which I visit the
pages. Two pages, two possible orderings:
1. /blog/search first
/blog/search: model => 'MyApp::Model::Blog', op => 'search'
/wiki/search: model => 'MyApp::Model::Wiki'
2. /wiki/search first
/wiki/search: model => 'MyApp::Model::Wiki', op => 'search'
/blog/search: model => 'MyApp::Model::Blog'
In both cases, the latter page loses the op arg, in fact the entire on
'search' run block is lost: it isn't triggered at all.
What's going on?
I'm using Jifty-0.80408.
Best,
Mikko
I'm having problems figuring out how to work with the Dispatcher.
This is what I have in the Dispatcher:
under [ 'blog', 'wiki' ] => [
run {
default model => "MyApp::Model::\u$1";
},
on 'search' => run {
set op => 'search';
},
];
on '**' => show 'dump'; # prints out whats in %ARGS
This is what I expect:
/blog/search: model => 'MyApp::Model::Blog', op => 'search'
/wiki/search: model => 'MyApp::Model::Wiki', op => 'search'
However, what I get is dependant upon the order in which I visit the
pages. Two pages, two possible orderings:
1. /blog/search first
/blog/search: model => 'MyApp::Model::Blog', op => 'search'
/wiki/search: model => 'MyApp::Model::Wiki'
2. /wiki/search first
/wiki/search: model => 'MyApp::Model::Wiki', op => 'search'
/blog/search: model => 'MyApp::Model::Blog'
In both cases, the latter page loses the op arg, in fact the entire on
'search' run block is lost: it isn't triggered at all.
What's going on?
I'm using Jifty-0.80408.
Best,
Mikko