2016-03-06 107 views
0
def incoming 
    sender = params[:From] 
    body = params[:Body] 
    @subscription = Subscription.all 

    twiml = Twilio::TwiML::Response.new do |r| 
     @subscription.each do |subs| 
     if (("+1"+(subs.customer.phone_number.to_s)) == sender) && (body.downcase == "unfollow") 
      r.Message "You are unsubscribed." 
      subs.destroy 

     elsif ("+1"+(subs.customer.phone_number.to_s)) == sender) 
      r.Message "I don't know that command." 

     else 


     end 
     end 

    end 
    render xml: twiml.text 

    end 

当我尝试将以上代码部署到heroku,heroku应用程序崩溃。 没有这部分代码,它运行良好。 我看着heroku日志,看起来像是在这个方法中制作一个无限循环。 我该如何将它变成非无限循环?Heroku无限循环

+0

你能告诉我们Heroku日志的相关部分吗? –

+0

我再次检查了日志,看起来像我有一个额外的'('。谢谢! – winteriscoming

回答