I have a rails controller and this code only loop through the first element in the metrics array? Why is that?
# /metrics/:id
def values
@metric = metrics.select do |metric|
id = metric['href'].split('/').last
p "id == params[:id] = #{id == params[:id]}" # false on the first iteration (but never gets to the next iteration
return id == params[:id]
end
p "HERE?" # We never get here!
end