[Dancer-users] Plugin::SimpleCRUD: primary key missing from edit form

WK wanradt at gmail.com
Thu Oct 20 11:39:28 CEST 2011


I played a bit with SimpleCRUD plugin and noticed on debug output,
that every time i submit edit form, there is made an INSERT. AFAIU,
insert is choosed if primary key is missing. Here is output of a
simple edit form, i don't see a primary key here:

<!-- Generated by CGI::FormBuilder v3.0501 available from
www.formbuilder.org -->
<form method="post" onsubmit="return validate(this);">
<div><input id="_submitted" name="_submitted" type="hidden" value="1" /></div>
<tr valign="top">
  <td><input id="keel" name="keel" type="text" value="udmurdi" /></td>
<tr valign="top">
  <td align="center" colspan="2"><input id="_submit" name="_submit"
type="submit" value="Submit" /></td>

Primary key for this simple table is 'ke_nr' (and other columns in
'keel', thats it) and it is set for simple_crud-method as that:

       record_title => "keel",
       prefix => "/keel",
       db_table => "keel",
       sortable => 1,
       paginate => 30,
       key_column => 'ke_nr',
       downloadable => 1,
       editable => 1,
       deletable => 1,

Why PK is missing from edit form?

Kõike hääd,


More information about the Dancer-users mailing list