【发布时间】:2016-09-05 17:27:37
【问题描述】:
我在演示者中使用button_to。这工作正常。但是,如果我创建一个块,我会收到错误
undefined method `stringify_keys'
我想知道是否可以在视图文件之外使用 button_to 块。
# Inside my presenter class
# The line below causes the error
button_to 'Big Button', '/', {} do
link_to('Home', '/', { })
end.html_safe
我该如何解决这个问题?我是否遗漏了一些相当明显的东西?
【问题讨论】:
-
为什么要在按钮中显示链接?
标签: ruby-on-rails ruby ruby-on-rails-4 presenter