show.html.erb file:
<%= button_to "1w", installation_path, params: { type: "graph", time: "week" }, :class => "button", :method => :get %>
show.js.erb file:
$("#main-graph").html("<%= escape_javascript(render :partial => 'graphs/consumptionsChart', :locals => {installation_id: @id_ins}) %>");
controller:
def show
if params[:type] == "graph"
@id_ins = "80"
respond_to do |format|
format.js
end
end
end
When I click in a button "1w" I receive the error "ActionController::UnknownFormat" in the line of "respond_to do |format|".