I have a collection_radio_buttons on a simple_form form on Ruby on Rails.
Code:
<%= f.collection_radio_buttons :player_out, @lineup.lineup_players.starting_players, :id, :name, label: "Player to get out?",
collection_wrapper_tag: :fieldset, collection_wrapper_class: "form-group radio_buttons optional substitution_suggestion_player_out",
item_wrapper_tag: :div, item_wrapper_class: "form-check" do |player| %>
<%= player.radio_button %>
<%= player.label { tag.div(player.text) } %>
<% end %>
I have two question about it:
1 - My label ("label: 'Player to get out?'") is not working. What I'm doing wrong?
2 - How do I call other methods of the collection? For example to get the player's avatar. :
<%= player.label { tag.div(image_tag(player.avatar) player.text) } %>
Thanks in advance.
David