<%args>
$object_type 
$region
</%args>
<%init>
my $record_class =  Jifty->config->framework('ApplicationClass')."::Model::".$object_type;
 my $create = Jifty->web->new_action(class => 'Create'.$object_type);
</%init>
<div class="jifty_admin create item inline">
% foreach my $argument ($create->argument_names) {
        <%$create->form_field($argument)%>
%}
</div>
<%

Jifty->web->form->submit(
    label    => 'Create',
    onclick  => [
                 { submit => $create },
                 { refresh_self => 1 },
                 {
                   element => $region->parent->get_element('div.list'),
                   append => '/__jifty/admin/fragments/list/view',
                   args   => { 
                              object_type => $object_type,
                              id          => { result_of => $create, name => 'id' },
                             },
                 },
                ]
    ) %>
</div>
<%doc>

When you hit "save" and create a item, you want to put a fragment
containing the new item in the associated list and refresh the current
fragment

</%doc>
