[Dancer-users] Plugin::SimpleCRUD: primary key missing from edit form
WK
wanradt at gmail.com
Thu Oct 20 11:39:28 CEST 2011
Terr!
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>
<table>
<tr valign="top">
<td><b>Keel</b></td>
<td><input id="keel" name="keel" type="text" value="udmurdi" /></td>
</tr>
<tr valign="top">
<td align="center" colspan="2"><input id="_submit" name="_submit"
type="submit" value="Submit" /></td>
</tr>
</table>
</form>
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:
simple_crud(
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?
--
Wbr,
Kõike hääd,
G
More information about the Dancer-users
mailing list