Pakyow Demo Messaging App Presenter 默认路由错误

Pakyow Demo Messaging App Presenter Error in Default Route

在您的博客中 post:http://pakyow.com/blog/2015/03/24/ui-intro 我一直在关注并在为视图部分配置默认路由时收到错误:具有空绑定集的表单。 view.partial(:form).scope[:message].bind({})

刷新浏览器时,出现如下错误。 不确定如何解决这个问题或我需要检查哪些依赖项。

服务器错误:

 The error originated on line 104 of 'C:/Ruby200/lib/ruby/gems/2.0.0/gems/pakyow-presenter-0.9.1/pakyow-presenter/lib/presenter/view.rb' and generated the following stack trace:

 wrong number of arguments (0 for 1)

 C:/Ruby200/lib/ruby/gems/2.0.0/gems/pakyow-presenter-0.9.1/pakyow-presenter/lib/presenter/view.rb:104:in `scope'
 C:/Ruby200/lib/ruby/gems/2.0.0/gems/pakyow-presenter-0.9.1/pakyow-presenter/lib/presenter/view_context.rb:44:in `method_missing'
 C:/Users/Anna/Documents/wallyou/app/lib/routes.rb:7:in `block (2 levels) in <top (required)>'
 C:/Ruby200/lib/ruby/gems/2.0.0/gems/pakyow-core-0.9.1/pakyow-core/lib/core/router.rb:102:in `instance_exec'
 C:/Ruby200/lib/ruby/gems/2.0.0/gems/pakyow-core-0.9.1/pakyow-core/lib/core/router.rb:102:in `block in call_fns'
 C:/Ruby200/lib/ruby/gems/2.0.0/gems/pakyow-core-0.9.1/pakyow-core/lib/core/router.rb:102:in `each'
 C:/Ruby200/lib/ruby/gems/2.0.0/gems/pakyow-core-0.9.1/pakyow-core/lib/core/router.rb:102:in `call_fns'
 C:/Ruby200/lib/ruby/gems/2.0.0/gems/pakyow-core-0.9.1/pakyow-core/lib/core/router.rb:140:in `block in trampoline'
 C:/Ruby200/lib/ruby/gems/2.0.0/gems/pakyow-core-0.9.1/pakyow-core/lib/core/router.rb:139:in `catch'
 C:/Ruby200/lib/ruby/gems/2.0.0/gems/pakyow-core-0.9.1/pakyow-core/lib/core/router.rb:139:in `trampoline'
 C:/Ruby200/lib/ruby/gems/2.0.0/gems/pakyow-core-0.9.1/pakyow-core/lib/core/router.rb:46:in `perform'
 C:/Ruby200/lib/ruby/gems/2.0.0/gems/pakyow-core-0.9.1/pakyow-core/lib/core/app.rb:245:in `block in process'
 C:/Ruby200/lib/ruby/gems/2.0.0/gems/pakyow-core-0.9.1/pakyow-core/lib/core/app.rb:242:in `catch'
 C:/Ruby200/lib/ruby/gems/2.0.0/gems/pakyow-core-0.9.1/pakyow-core/lib/core/app.rb:242:in `process'
 C:/Ruby200/lib/ruby/gems/2.0.0/gems/pakyow-core-0.9.1/pakyow-core/lib/core/app.rb:223:in `call'
 C:/Ruby200/lib/ruby/gems/2.0.0/gems/pakyow-core-0.9.1/pakyow-core/lib/core/middleware/reloader.rb:10:in `call'
 C:/Ruby200/lib/ruby/gems/2.0.0/gems/pakyow-core-0.9.1/pakyow-core/lib/core/middleware/logger.rb:118:in `block in call'
 C:/Ruby200/lib/ruby/gems/2.0.0/gems/pakyow-core-0.9.1/pakyow-core/lib/core/middleware/logger.rb:129:in `time'
 C:/Ruby200/lib/ruby/gems/2.0.0/gems/pakyow-core-0.9.1/pakyow-core/lib/core/middleware/logger.rb:116:in `call'
 C:/Ruby200/lib/ruby/gems/2.0.0/gems/pakyow-core-0.9.1/pakyow-core/lib/core/middleware/static.rb:20:in `call'
 C:/Ruby200/lib/ruby/gems/2.0.0/gems/rack-1.6.1/lib/rack/methodoverride.rb:22:in `call'
 C:/Ruby200/lib/ruby/gems/2.0.0/gems/rack-1.6.1/lib/rack/builder.rb:153:in `call'
 C:/Ruby200/lib/ruby/gems/2.0.0/gems/puma-2.11.2/lib/puma/server.rb:507:in `handle_request'
 C:/Ruby200/lib/ruby/gems/2.0.0/gems/puma-2.11.2/lib/puma/server.rb:375:in `process_client'
 C:/Ruby200/lib/ruby/gems/2.0.0/gems/puma-2.11.2/lib/puma/server.rb:262:in `block in run'
 C:/Ruby200/lib/ruby/gems/2.0.0/gems/puma-2.11.2/lib/puma/thread_pool.rb:104:in `call'
 C:/Ruby200/lib/ruby/gems/2.0.0/gems/puma-2.11.2/lib/puma/thread_pool.rb:104:in `block in spawn_thread'

scope 应该是一个函数调用,像这样:

view.partial(:form).scope(:message).bind({})

按照你的方式,message 括在方括号中。