Twilio消息体-Ruby on Rails

Twilio消息体-Ruby on Rails,ruby,ruby-on-rails-3.2,twilio,Ruby,Ruby On Rails 3.2,Twilio,我和Twilio之间有个小问题。我正在尝试发送一些短信 用户数据库表中的数据,以便我可以验证他们是谁 从用户控制器 def verifymobile @user = User.find(params[:id]) message_to_send = @user.phoneverify # Instantiate a Twilio client client = Twilio::REST::Client.new(TWILIO_CONFIG['sid'], T

我和Twilio之间有个小问题。我正在尝试发送一些短信 用户数据库表中的数据,以便我可以验证他们是谁

从用户控制器

  def verifymobile
    @user = User.find(params[:id])
     message_to_send  = @user.phoneverify

    # Instantiate a Twilio client
    client = Twilio::REST::Client.new(TWILIO_CONFIG['sid'], TWILIO_CONFIG['token'])

    # Create and send an SMS message
    client.account.sms.messages.create(
        from: TWILIO_CONFIG['from'],
        to: @user.cellphone,
        body: "Thanks for signing up with Afrocoin. To verify your account, 
             Please use CODE #{message_to_send}"
    )

    redirect_to :action => 'index'
  end

我在获取消息正文(@user.phoneverify)中的数据时遇到问题。请您告知

您确定@user和@user.phoneverify有一个有效值吗?

您确定
@user
@user.phoneverify有一个有效值吗。2) 
要发送的消息
为零。3) 将字符串设置为变量。没有说这些都是正确的。只是需要考虑的事情。那里什么也没有。你为什么不加一个答案让我接受呢。