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


See more with Deloitte. 2012 Employer of Choice for Women (EOWA) and Inclusive Workplace of the Year (AHRI Diversity Awards).

This e-mail and any attachments to it are confidential. You must not use, disclose or act on the e-mail if you are not the intended recipient. If you have received this e-mail in error, please let us know by contacting the sender and deleting the original e-mail.
Liability limited by a scheme approved under Professional Standards Legislation.
Deloitte refers to one or more of Deloitte Touche Tohmatsu Limited, a UK private company limited by guarantee, and its network of member firms, each of which is a legally separate and independent entity. Please see www.deloitte.com.au/about for a detailed description of the legal structure of Deloitte Touche Tohmatsu Limited and its member firms.