Reputation: 1259
I have just finished programming an import/export feature for an existing complex website. The way it is set up is that on the games/5 show action, I have an "Import" and an "Export" button. These lead to appropriately-named controller actions, which do the importing/exporting and then render :action => show
again.
Clicking on the exporting action gives an "We're sorry, but something went wrong" message, and the production.log gives
Started GET "/games/3/export" for 212.87.32.10 at 2012-05-30 09:30:18 +0000
Processing by GamesController#export as HTML
Parameters: {"id"=>"3"}
Started GET "/favicon.ico" for 212.87.32.10 at 2012-05-30 09:30:50 +0000
ActionController::RoutingError (No route matches [GET] "/favicon.ico"):
actionpack (3.2.2) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
actionpack (3.2.2) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
railties (3.2.2) lib/rails/rack/logger.rb:26:in `call_app'
railties (3.2.2) lib/rails/rack/logger.rb:16:in `call'
...
Why is Rails only complaining about the favicon in this one action, when there are hundreds of pages using the same template?? Considering I'm rendering the same old 'show' action, why doesn't it at least complain on the 'show' page before? And why does a missing graphic cause a "We're sorry, but something went wrong" message anyway?
My favicon is actually hosted off-site, the link in application.html.erb is
<link rel="shortcut icon" href="http://www.wooga.com/wp-content/themes/wooga-dev/images/favicon.ico" type="image/x-icon" />
Upvotes: 0
Views: 2489
Reputation: 30995
It's not "Rails complaining about favicon.ico in one action", it's "web browser tries to fetch favicon.ico which this app doesn't have". Try to dig why your browser wants it there? Are you returning something else from this action? Dig in Chrome Inspector's/Firebug's Network tab, check response headers/body, check when exactly your browser tries to fetch favicon.ico file (maybe it's before response body returned, because it took too long?)
Also about your last question:
And why does a missing graphic cause a "We're sorry, but something went wrong" message anyway?
Rails doesn't know that "/favicon.ico" should return image file. It's standard request with 404 response, which by default return "We're sorry..." message.
Upvotes: 4