title: Rails serving pages twice
body: <p>Running into a wierd error where rails 4 is serving pages twice. </p>
  
  <p>Tried the solutions </p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/5786283/rails-seems-to-be-serving-the-page-twice">here</a> but no dice</li>
  <li>The assets are not precompiled so no conflict there.</li>
  </ul>
  
  <p>I'm stumped. Any idea what might be going on?</p>
  
  <p>Here are the server logs. Development and production modes suffer the same problem.</p>
  
  <pre><code>Started GET "/" for 127.0.0.1 at 2013-12-21 16:29:23 +0800
  Started GET "/" for 127.0.0.1 at 2013-12-21 16:29:23 +0800
  Processing by StaticPagesController#home as HTML
  Processing by StaticPagesController#home as HTML
    Rendered static_pages/home.html.erb within layouts/application (0.2ms)
    Rendered static_pages/home.html.erb within layouts/application (0.2ms)
  DEPRECATION WARNING: link_to_function is deprecated and will be removed from Rails 4.1. We recommend using Unobtrusive JavaScript instead. See http://guides.rubyonrails.org/working_with_javascript_in_rails.html#unobtrusive-javascript. (called from _app_views_layouts__drawer_html_erb__3283824921749738462_70245236444620 at /Users/macintosh/rails_projects/moneybaby/app/views/layouts/_drawer.html.erb:3)
  DEPRECATION WARNING: link_to_function is deprecated and will be removed from Rails 4.1. We recommend using Unobtrusive JavaScript instead. See http://guides.rubyonrails.org/working_with_javascript_in_rails.html#unobtrusive-javascript. (called from _app_views_layouts__drawer_html_erb__3283824921749738462_70245236444620 at /Users/macintosh/rails_projects/moneybaby/app/views/layouts/_drawer.html.erb:3)
    Rendered layouts/_drawer.html.erb (75.9ms)
    Rendered layouts/_drawer.html.erb (75.9ms)
  DEPRECATION WARNING: link_to_function is deprecated and will be removed from Rails 4.1. We recommend using Unobtrusive JavaScript instead. See http://guides.rubyonrails.org/working_with_javascript_in_rails.html#unobtrusive-javascript. (called from _app_views_layouts__header_html_erb__2675263796791980695_70245236072180 at /Users/macintosh/rails_projects/moneybaby/app/views/layouts/_header.html.erb:27)
  DEPRECATION WARNING: link_to_function is deprecated and will be removed from Rails 4.1. We recommend using Unobtrusive JavaScript instead. See http://guides.rubyonrails.org/working_with_javascript_in_rails.html#unobtrusive-javascript. (called from _app_views_layouts__header_html_erb__2675263796791980695_70245236072180 at /Users/macintosh/rails_projects/moneybaby/app/views/layouts/_header.html.erb:27)
    Rendered layouts/_header.html.erb (1.5ms)
    Rendered layouts/_header.html.erb (1.5ms)
    Rendered layouts/_footer.html.erb (0.4ms)
    Rendered layouts/_footer.html.erb (0.4ms)
  Completed 200 OK in 108ms (Views: 107.1ms | ActiveRecord: 0.0ms)
  Completed 200 OK in 108ms (Views: 107.1ms | ActiveRecord: 0.0ms)  
  
  Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-12-21 16:29:23 +0800
  Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-12-21 16:29:23 +0800 
  
  Started GET "/assets/foundation_and_overrides.css?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  Started GET "/assets/foundation_and_overrides.css?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800  
  
  Started GET "/assets/header_and_footer.css?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  Started GET "/assets/header_and_footer.css?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  
  Started GET "/assets/layout.css?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  Started GET "/assets/layout.css?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  
  Started GET "/assets/life_insurances.css?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  Started GET "/assets/life_insurances.css?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  
  Started GET "/assets/static_pages.css?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  Started GET "/assets/static_pages.css?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  
  Started GET "/assets/jquery.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  Started GET "/assets/jquery.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  
  Started GET "/assets/foundation/foundation.abide.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  Started GET "/assets/foundation/foundation.abide.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  
  Started GET "/assets/jquery_ujs.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  Started GET "/assets/jquery_ujs.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  
  Started GET "/assets/foundation/foundation.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  Started GET "/assets/foundation/foundation.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  
  Started GET "/assets/vendor/modernizr.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  Started GET "/assets/vendor/modernizr.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  
  Started GET "/assets/foundation/foundation.accordion.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  Started GET "/assets/foundation/foundation.accordion.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  
  Started GET "/assets/foundation/foundation.clearing.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  Started GET "/assets/foundation/foundation.clearing.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  
  Started GET "/assets/foundation/foundation.dropdown.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  Started GET "/assets/foundation/foundation.dropdown.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  
  Started GET "/assets/foundation/foundation.interchange.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  Started GET "/assets/foundation/foundation.interchange.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  
  Started GET "/assets/logoblue.png" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  Started GET "/assets/logoblue.png" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  
  Started GET "/assets/foundation/foundation.alert.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  Started GET "/assets/foundation/foundation.alert.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  
  Started GET "/assets/logodark.png" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  Started GET "/assets/logodark.png" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  
  Started GET "/assets/foundation/foundation.tab.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  Started GET "/assets/foundation/foundation.tab.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  
  Started GET "/assets/foundation/foundation.orbit.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  Started GET "/assets/foundation/foundation.orbit.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  
  Started GET "/assets/foundation/foundation.offcanvas.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  Started GET "/assets/foundation/foundation.offcanvas.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  
  Started GET "/assets/foundation/foundation.magellan.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  Started GET "/assets/foundation/foundation.magellan.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  
  Started GET "/assets/foundation/foundation.joyride.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  Started GET "/assets/foundation/foundation.joyride.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  
  Started GET "/assets/foundation/foundation.reveal.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  Started GET "/assets/foundation/foundation.reveal.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  
  
  Started GET "/assets/foundation/foundation.tooltip.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  Started GET "/assets/foundation/foundation.tooltip.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  
  Started GET "/assets/foundation.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  Started GET "/assets/foundation.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  
  Started GET "/assets/foundation/foundation.topbar.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  Started GET "/assets/foundation/foundation.topbar.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  
  Started GET "/assets/turbolinks.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  Started GET "/assets/turbolinks.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  
  Started GET "/assets/life_insurances.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  Started GET "/assets/life_insurances.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  
  Started GET "/assets/static_pages.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  Started GET "/assets/static_pages.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  
  Started GET "/assets/zepto_slideupdown.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  Started GET "/assets/zepto_slideupdown.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  
  Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
  </code></pre>