Basically, I am trying to create a dynamic group of checkboxes that are disconnected from the category selection in the same form. For example, the user will select a category from the selected one, and then a list of relevant subcategories will appear.
I did this before using only selections, but it is much simpler because you only need to provide a common set of parameters. Flags (especially with formtastic) have many corresponding markups that I would rather not generate.
So my question is how to get formtastic to create only the correct checkboxes, but still their name and identifier fields contain all the correctly nested information. I want it to act as shown below, but only output the last line to send via ajax.
= semantic_form_for @user do |u| = u.inputs :name, :age = semantic_fields_for :job do |f| = f.input :category, :as => :select, :collection => Category.all = f.input :subcategory, :as => :check_boxes, :collection =>
I tried using the last line wrapped in a generic semantic_fields_for , but the field names are no longer valid.
How do you do this?
source share