respond_to UnknownFormat

时间:2015-12-21 15:18:24

标签: ruby-on-rails ajax

show.html.erb文件:

expect(array).to.include.something.that.deep.equals({ ??, a: 1, c: 3});

show.js.erb文件:

contain.a.thing.with.property

控制器:

<%= button_to "1w", installation_path, params: { type: "graph", time: "week" },  :class => "button", :method => :get %>

当我点击一个按钮&#34; 1w&#34;我收到错误&#34; ActionController :: UnknownFormat&#34;在&#34; respond_to do | format |&#34;。

的行中

1 个答案:

答案 0 :(得分:0)

试试这个

<%= button_to "1w", installation_path(:format => "js"), params: { type: "graph", time: "week" },  :class => "button", :method => :get %>