if @mentions is an empty array (which the mentions local variable you create below is), then you can use @mentions.each without a guarding if statement.