I have these 2 partials written for my Ruby on Rails application. Is there any clever way two merge them into one? Copy pasting one partial into the other is not allowed
What I would like to have is something like this:
@member = 'Player'
render 'team/team_partial'
@member = 'Staff'
render 'team/team_partial'
Or any other clever way that deals with the redundancy of the code is accepted.
.row .col-md-6.info_block .row .col-md-10.col-md-offset-1 = icon 'user' .caption h3.col-md-6.col-md-offset-3 |Players: table tbody - @team.players.each do |player| tr td = icon 'check' td |Name: a href= '#' = player.name td = form_for(@team, url: team_path(@team), method: :delete, html:{class:"team_member_form"}) do |f| = hidden_field_tag :player, player.id = f.submit "Delete", class:"btn btn-danger btn-sm", data: { confirm: "Are you sure?" } button type="button" class="btn btn-success showModal" data-toggle="modal" data-target="#exampleModal" data-member="Player" |Add Player
2.
.row
.col-md-10.col-md-offset-1
= icon 'user'
.caption
h3.col-md-6.col-md-offset-3
|Staff:
table
tbody
- @team.staff.each do |staff|
tr
td = icon 'check'
td
|Name:
a href= #
= staff.name
td
= form_for(@team, url: team_path(@team), method: :delete, html:{class:"team_member_form"}) do |f|
= hidden_field_tag :staff, staff.id
= f.submit "Delete", class:"btn btn-danger btn-sm", data: { confirm: "Are you sure?" }
button type="button" class="btn btn-success showModal" data-toggle="modal" data-target="#exampleModal" data-member="Staff"
i class="glyphicon glyphicon-plus"
|Add Staff