2013-05-12 21 views
0

为什么没有此代码的工作button_to带给我的意外错误“ n”

= button_to 'del', {controller: 'my_controller', action: 'my_action'}, method: :delete, {style: 'float: left;'} 

它给我的syntax error, unexpected '\n', expecting tASSOC

错误,但如果我改变它是= button_to 'del'那么它的工作原理好。

我是怎么错了,我怎么做的所有参数呢?

+0

yes ............. – 2013-05-12 05:51:37

回答

1

你需要用大括号包装method: :delete

button_to 'del', {controller: 'my_controller', action: 'my_action'}, {method: :delete}, {style: 'float: left;'} 

工程。