Question

I have the following models:

Category

has_and_belongs_to_many :subcategories
has_many :resources

Subcategory

has_and_belongs_to_many :categories
has_and_belongs_to_many :resources
Resource

has_and_belongs_to_many :subcategories
belongs_to  :category

In Rails_Admin when creating or editing a resource I want to show the subcategories for the chosen category.

How can I do this in rails_admin?

Was it helpful?

Solution

This post should give you a couple of options to get you what you need. And, here is another post about building custom views for the relationships in rails_admin.

Edited

Check out this post Rails3 + Typus: display habtm relationship as checkboxes

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top