1

I have a team, and the team has many players. I want to show the player's names in a form and allow the user to update these names. How can i solve this problem? I am new in rails.The code is in .html.haml, and it gives me an error when i add the text_field.

.top
  = form_for @team, method: 'post', url: '/training/update_points' do |t|
    = button_to (t 'teams.training.save_changes'), { action: 'update_points', controller: 'training'}, method: 'post', class: 'submit-button-skill'
.columns-wrapper
  - unless @players.blank?
    %table.pretty
      %tr{class: 'row-wrapper'}
        %th{class: 'row-parameter-name'}= t 'teams.training.name'
      - for player in @team.players
        %tr{class: 'players-container'}
          %td{class: 'players-name-container'}
            .players-name2
              = t.text_field :name
            .players-number
              = "##{ player.number }"

0 Answers0