Как я могу показать, в каких командах участвует пользователь?
Моя домашняя страница для зарегистрированных пользователей:
<div class="container">
<h1 class="display-3">Your Teams</h1>
<p></p>
</div>
Моя модель user.rb:
class User < ApplicationRecord
has_many :memberships
has_many :teams, through: :memberships
devise :database_authenticatable, :registerable, :confirmable,
:recoverable, :rememberable, :validatable
end
Модель моей team.rb:
class Group < ApplicationRecord
has_many :memberships
has_many :users, through: :memberships
validates_uniqueness_of :name
end
Модель моего членства.rb:
class Membership < ApplicationRecord
belongs_to :user
belongs_to :team
end