My fellow stackoverflowers and I couldn't solve this problem: How to append correct details based upon category?
So I think the best alteative is to reload the page every time the user switches the attribute category.
<%= f.radio_button :category, 'goal', class: 'date-format-switcher' %>
<label for="challenge_category_goal">Goal</label>
<%= f.radio_button :category, 'habit', class: 'date-format-switcher' %>
<label for="challenge_category_habit">Habit</label>
<% if @challenge.category == 'goal' %>
<%= render 'challenges/nested_goals.html.erb' %>
<% else %>
<%= render 'challenges/nested_habits.html.erb' %>
<% end %>
