خرید بک لینک

Vote count: 0

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 %>

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: يکشنبه 5 ارديبهشت 1395 ساعت: 7:02

صفحه بندی