在Sinatra崩溃的模板内的苗条模板

时间:2014-10-18 00:06:27

标签: ruby slim-lang

我和Sinatra一起使用苗条并且有一个奇怪的问题。在一个纤薄的模板里面,我试图渲染另一个苗条的样子:

p
  == slim :search_form

这在另一个模板中完美运行,但由于某种原因,我得到以下异常:

127.0.0.1 - - [17/Oct/2014 20:00:47] "GET /__sinatra__/500.png HTTP/1.1" 304 - 0.0010
NoMethodError - undefined method `join' for #<String:0x007f9dc2c39f30>:
        views/results.slim:45:in `block in singleton class'
        views/results.slim:-1:in `instance_eval'
        views/results.slim:-1:in `singleton class'
        views/results.slim:-3:in `__tilt_70157989336980'
        /Users/brendan/.rbenv/versions/2.0.0-p481/lib/ruby/gems/2.0.0/gems/tilt-1.4.1/lib/tilt/template.rb:170:in `call'
        /Users/brendan/.rbenv/versions/2.0.0-p481/lib/ruby/gems/2.0.0/gems/tilt-1.4.1/lib/tilt/template.rb:170:in `evaluate'
        /Users/brendan/.rbenv/versions/2.0.0-p481/lib/ruby/gems/2.0.0/gems/tilt-1.4.1/lib/tilt/template.rb:103:in `render'
        /Users/brendan/.rbenv/versions/2.0.0-p481/lib/ruby/gems/2.0.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:814:in `render'
        /Users/brendan/.rbenv/versions/2.0.0-p481/lib/ruby/gems/2.0.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:742:in `slim'
        app.rb:80:in `block in <class:Website>'
        /Users/brendan/.rbenv/versions/2.0.0-p481/lib/ruby/gems/2.0.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:1603:in `call

0 个答案:

没有答案