I’m trying to ‘destroy’ a particular record of a table
From the controller side, i’ve found a list of possible records that i
ie. @chart = Chart.find(:all, :conditions => [“record_id = ?”,
‘id’ is passed into the controller and @chart is all the possible
records that have record_id = id.
My problem is this. I know there is only one chart w/ record_id = id.
But the search that i’ve done thinks that there could be a magnitude of
charts with record_id = id. I need to be able to find the chart that
has record_id = id so i can delete this chart.
From the view side, I was able to solve a similar sitiuation with
@chart.each do |chart|
if chart.record_id = id
Is there a way to do a similar for loop from the controller side?