From 59c7807ac1fbd85523762287967242fe85403b17 Mon Sep 17 00:00:00 2001 From: Agnieszka Figiel Date: Tue, 9 Jun 2015 08:04:59 +0100 Subject: [PATCH] explicitly respond to html to prevent missing template errors when browsers send incorrect content-type --- app/controllers/cites_trade/home_controller.rb | 4 +++- app/controllers/species/ember_controller.rb | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/controllers/cites_trade/home_controller.rb b/app/controllers/cites_trade/home_controller.rb index fd0ef83529..1f75fc4b34 100644 --- a/app/controllers/cites_trade/home_controller.rb +++ b/app/controllers/cites_trade/home_controller.rb @@ -1,7 +1,9 @@ class CitesTrade::HomeController < CitesTradeController def index - @years = (1975..Trade::Shipment.maximum('year')).to_a.reverse + respond_to do |format| + format.html { @years = (1975..Trade::Shipment.maximum('year')).to_a.reverse } + end end def download diff --git a/app/controllers/species/ember_controller.rb b/app/controllers/species/ember_controller.rb index 0122bb8af6..1ceab13c29 100644 --- a/app/controllers/species/ember_controller.rb +++ b/app/controllers/species/ember_controller.rb @@ -1,5 +1,8 @@ class Species::EmberController < ApplicationController layout 'species' def start + respond_to do |format| + format.html { } + end end end