尝试编写具有 3 个基本条件的辅助方法。添加第三个尝试将当前用户排除在结果之外的结果会导致错误。
def male_soccer_players
return User.where(:gender => "male", :soccer => true, :id != current_user.id)
end
错误是
app/controllers/application_controller.rb:12: syntax error, unexpected ')', expecting =>