Hi Dancer users
I hope you can help me. I’m pretty new to Dancer and I’m trying to write a simple web service for note taking. The SimpleCRUD module looks perfect for my needs, but I need to add a timestamp to the record
that SimpleCRUD creates.
From the documentation I assume the right way to do this is with the 'add_edit_row_pre_save' hook, but the code in that sub doesn’t seem to ever get called.
simple_crud(
record_title => 'Log item',
prefix => '/crud',
db_table => 'prototype',
editable => 1,
editable_columns => [ qw( UFirstName ULastName Details Type KFirstName KLastName Outcome ) ],
add_edit_row_pre_save => sub {
my $row = shift;
open TESTOUTPUT, ">", "TEST.txt" or die "$!";
print TESTOUTPUT "hello";
close TESTOUTPUT;
},
);
Does anyone have some sample code or tips on how to implement ‘add_edit_row_pre_save’ that they would be willing to share? My Googling turned up nothing.
Many thanks
Taps