I'm managing my admin backend with Typus
I want to add a field with a checkbox for each category.
I used this code:
Post:
fields:
default: name, description, user, categories
list: name, description, user, categories
form: name, description, user, categories
relationships: categories
But the result is a textfield with a [] inside: how do I solve this?
Is there a native way or must I override the field template?
To show the the checkbox for the fields you can use the existing template of the Typus
Post:
fields:
default: name, description, user, categories
list: name, description, user, categories
form: name, description, user, categories
options:
templates:
categories: boolean
relationships: categories`
来源:https://stackoverflow.com/questions/4270512/rails3-typus-display-habtm-relationship-as-checkboxes