[Catalyst] Relative links

Pedro Melo melo at simplicidade.org
Thu Nov 10 12:02:35 CET 2005


Hi,

On Nov 9, 2005, at 10:18 PM, Andreas Marienborg wrote:
> On 9. nov. 2005, at 22.59, Bill Moseley wrote:
>> On Wed, Nov 09, 2005 at 09:22:26PM +0000, Matt S Trout wrote:
>>> On Wed, Nov 09, 2005 at 01:02:08PM -0800, Bill Moseley wrote:
>>>> I originally was creating a $c->stash->{myself} entry for
>>>> self-referencing links in all my controllers.  Seems like the  
>>>> only way
>>>> since Catalyst can't really know what action is the "self".
>
> What I do for things like delete and stuff like that, is I redirect  
> afterwards, back to the list.
>
> That way the url stays nice and clean, and chance of problems like  
> this is less I think.

I have to do a +1 on this reply :).

One other reason to do the redirect is to avoid reload issues. If the  
URL still shows /admin/things/delete?o=X and it's showing the list,  
if I hit reload, it will post the previous form again, and depending  
on how you code your app, it could do nothing or bad things. Either  
way, it's messy from a user pov, IMHO.

I always redirect back to the list or view action after any action  
based on POST or that modifies the state of the app. You can also  
include a error or success message when you redirect.

Best regards,
--
Pedro Melo
JID: melo at simplicidade.org




More information about the Catalyst mailing list