undefined method for #
I want show all price for all finds days.
in controller view
def view
@travel = Travel.find(params[:id])
@car = Car.find(:first, :conditions => ["id = ?", @travel.car_id])
@start_day = StartDay.find(:all, :conditions => ["travel_id = ?",
@travel.id])
@import_price = ImportPrice.find(:all,
:conditions => ["begin_date = ? and car_code = ?",
@start_day.day, @car.short_name])
end
When I add value @import_price appears error:
undefined method `day' for #<Array:0x7feb70d56fe8>
How me make the correct selection for all days?
Thanks in advance.
ruby 1.8.7 rails 2.3
No comments:
Post a Comment