diff options
author | wreis <wreis@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7> | 2009-08-05 01:58:14 +0000 |
---|---|---|
committer | wreis <wreis@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7> | 2009-08-05 01:58:14 +0000 |
commit | b210789fed64cda65459e48b7f68b88733c04dd7 (patch) | |
tree | c8ca8ef75b411cd4e9b02a38f670db09eeb24760 /lib/Reaction | |
parent | 2f4c7285eeda79854ef6fc2ebbd878e89d1d19e3 (diff) | |
parent | 4b70129e4e977a51616faaaeefd61a39367861f0 (diff) | |
download | reaction-b210789fed64cda65459e48b7f68b88733c04dd7.tar.gz reaction-b210789fed64cda65459e48b7f68b88733c04dd7.zip |
r4466@www43 (orig r1196): groditi | 2009-08-01 15:07:10 -0500
make "class" in the config for push_vieport work correctly
r4488@www43 (orig r1199): groditi | 2009-08-03 17:25:09 -0500
let delete have its own callback by default
r4499@www43 (orig r1207): groditi | 2009-08-04 11:01:28 -0500
r30359@martha (orig r1198): groditi | 2009-08-01 16:57:29 -0400
example of how to create forms that return users to the URI they came from
Diffstat (limited to 'lib/Reaction')
-rw-r--r-- | lib/Reaction/UI/Controller.pm | 4 | ||||
-rw-r--r-- | lib/Reaction/UI/Controller/Collection/CRUD.pm | 10 |
2 files changed, 10 insertions, 4 deletions
diff --git a/lib/Reaction/UI/Controller.pm b/lib/Reaction/UI/Controller.pm index 46456bd..8ed781f 100644 --- a/lib/Reaction/UI/Controller.pm +++ b/lib/Reaction/UI/Controller.pm @@ -26,9 +26,7 @@ sub push_viewport { $vp_attr = $vp_attr->[0]; } if (ref($vp_attr) eq 'HASH') { - if (my $conf_class = delete $vp_attr->{class}) { - $class = $conf_class; - } + $class = $vp_attr->{class} if defined $vp_attr->{class}; %args = %{ $self->merge_config_hashes($vp_attr, {@proto_args}) }; } else { $class = $vp_attr; diff --git a/lib/Reaction/UI/Controller/Collection/CRUD.pm b/lib/Reaction/UI/Controller/Collection/CRUD.pm index 6dfed13..11a29f9 100644 --- a/lib/Reaction/UI/Controller/Collection/CRUD.pm +++ b/lib/Reaction/UI/Controller/Collection/CRUD.pm @@ -90,13 +90,21 @@ sub on_update_close_callback { sub delete :Chained('object') :Args(0) { my ($self, $c) = @_; - my $close = sub { $self->on_update_close_callback( @_) }; + my $close = sub { $self->on_delete_close_callback( @_) }; my $vp_args = { on_close_callback => $self->make_context_closure($close), }; $self->basic_model_action( $c, $vp_args); } +sub on_delete_close_callback { + my($self, $c) = @_; + #this needs a better solution. currently thinking about it + my @cap = @{$c->req->captures}; + pop(@cap); # object id + $self->redirect_to($c, 'list', \@cap); +} + sub basic_model_action { my ($self, $c, $vp_args) = @_; my $stash = $c->stash; |