目前我正在使用这样的 respond_to
.
respond_to do |format|
format.html {render layout: false }
end
我知道像 respond_to {| format | format.html }
这样的句子可以写成 respond_to :html
. 但是如果 format.html
也有块参数,我如何在没有第一个块的情况下编写?
我想写像 respond_to :html, {render layout: false }
.
1 回答
难道你和
respond_with
混淆了吗?respond_with
可以配置为respond_to
:有关
respond_with
的更多信息,请参见API documentation或this Railscast .