Answer the question
In order to leave comments, you need to log in
How to make adding a child element in ActiveAdmin?
I have products and categories. Now, when creating/editing a product, I simply select a category from the list.
I would like to make it so that when viewing a category in the admin panel, there would be a button "Add product to category" and that would be redirected to the product creation page, where the parent category is already selected.
Can this be done at all?
Answer the question
In order to leave comments, you need to log in
Hello, you need to add a link to create a product in the show block in category.rb, something like this
show do
attributes_table do
div do
link_to 'New product', new_admin_category_product_path(category_id: category)
end
end
end
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question