i have this code where i get the field name dynamically .
field_name = #code to get field name as string
im then then looping through an array of activer record objects
results. each do |record|
puts "#{record.field_name}"
end
how do i evaluate that puts statement in ruby?
The Ruby way:
record.send(field_name)Another way with ActiveRecord:
record[field_name]