model's foreign key select labels
hello everyone
ive been using codeigniter for a while, and fuel cms really great in that it could save so much time. but im having some issues with it.
im writing a simple model 'commercials' with a foreign key 'title' of model 'text' (so i could select a title from 'texts' and have it translated in the text model). Viewing from fuel admin, the commercials/edit page, i see the 'title' foreign key as a select box, but the labels are all '0' because its showing the wrong collumn. so how do i set it to use a different collumn in the foreign key select box?
Comments
i just changed the database collumn order and that helped with displaying the option label, and i just found out theres a 'display_field' setting in my_fuel_models! ok now i can see the right labels, without having to reorder collumns, but i would like to filter them too... maybe there's a function i can ovveride that collects these foreign key options?
Just tested to be sure, with a numeric value as the second column and both display_field and default_col set to name, I still see the numeric column value as the select label.
You can override the options list behaviour. You'll need to have an options_list() method in your model.