So I am trying to get a URL that looks like this:
http://localhost:3000/admin/itemtype/32/edit
Instead, I am getting URLs that look like:
http://localhost:3000/admin/itemtype/edit/32
In my template, I tried this:
[% c.uri_for( 'edit', [ item_type.type_id ]) %]
which gave me the latter URL. If I do this:
[% c.uri_for(c.controller('Admin::ItemType').action_for('edit'), [item_type.type_id] ) %]
I get what I want, but it seems too clunky to be doing in my view. Is there a simpler way to write that and have it still work? It seems like too common a thing to not have there be a simpler way, but I am just not finding it.
Chained actions (Score:1)
You might want to look at chained actions: Catalyst::DispatchType::Chained [cpan.org].
That gives you an easy way to have URIs like
And you can set the URI via:
What goes into captures and what into arguments depends on your application design.
While the version of uri_for() that uses an action object instead of a string seems a bit more work, it gives you one hug
Ordinary morality is for ordinary people. -- Aleister Crowley
Excerpt from $work (Score:1)
From
MyApp.pm:Re: (Score:1)
Woops, that would be:
(The actual method i