bigpresh / bigpresh/Dancer-Plugin-SimpleCRUD

/table/add form confusing with labels and foreign keys

Open
#75 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Perl
Stars
26
Forks
31
PR merge metrics
No merged PRs in 30d

Description

If I have a two tables and a simple_crud interface like:

```
create table things ( id int, name varchar, category_id int);
create table categories ( id int, name varchar, );

simple_crud(
prefix=> '/things',
db_table=>'things',
foreign_keys => { strategy_id => { table=>'categories', key_column=>'id', label_column=>'name' }},
labels => { category_id=>"Category" },
);
```

Then when viewing the /things/add form , then for the 'category_id' field of the things table will show an input labelled 'category' even though you have to enter a 'category_id'.

In some cases this is correct (when there's only one row in the categories table, then it seems like it'll show a checkbox for that category), but if asking for a category id this is misleading.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the /things/add form from the issue using the shown things and categories tables, then trace the simple_crud foreign-key and labels handling. Done means the category_id field's label and input make clear whether the user selects a category or enters an ID, including the single-category case.

Written by the indexing model from the issue text.

Assessment

Tech stack
perl
Domain
backend, database
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.