Twilio アプリケーションのコントローラーに次のコードがあり、「id = user...」行にエラーが表示されます。
class CallsController < ApplicationController
def play
user = Refugee.find_all_by_cell_number(params[:id]) && Student.find_all_by_cell_number(params[:id])
id = user[:last_class].to_i
lesson = RecordedLesson.find(id).next
user[:last_class] = lesson.id
user.save
@audio_lesson_url = lesson.sound_file.url
render :action => "play.xml.builder", :layout => false
end
end
次に、次のエラーメッセージが表示されます
app/controllers/calls_controller.rb:7:in `play'=2012-09-18T04:00:13+00:00 app[web.1]: TypeError (can't convert Symbol into Integer):
これは、次の移行を実行したにもかかわらずです
class ChangeLastClassOfStudents < ActiveRecord::Migration
def change
change_column :students, :last_class, :integer, :null => true
end
end