Note that there are some explanatory texts on larger screens.

plurals
  1. PORails 3.1.10 - Homepage loads twice but if I add a trailing '/' to the URL it works fine (loads once)
    primarykey
    data
    text
    <p><strong>Server</strong>: Rails 3.1.10 and Ruby 1.9.2 on Ubuntu 11.10 (Oneiric). <strong>Client</strong>: Windows 7, Chrome 29.0.1547.66 m.</p> <p>I have a small but annoying problem: checking my logs, I see that my homepage loads twice. Strangely though, it works correctly (loads only once) if I append a '/' to the URL.</p> <p>This appeared after I removed some unneeded gems from bundler. I also removed the require statement for 'rails/all' in my config file and instead am using selected railties because I don't need a DB/model.</p> <p>I've checked the answer <a href="https://stackoverflow.com/questions/5786283/rails-seems-to-be-serving-the-page-twice">here</a> but no luck - there doesn't seem to be a missing asset source or href, and the double load also appears in 'incognito' browser mode. I also tested after disabling all extensions on Chrome.</p> <p><strong>application.rb</strong>:</p> <pre><code>#require 'rails/all' (commented out - active_record &amp; test_unit are not needed) #------------------------------------------ %w( action_controller action_mailer sprockets ).each do |framework| begin require "#{framework}/railtie" rescue LoadError end end </code></pre> <p><strong>routes.rb</strong>:</p> <pre><code> match '/' =&gt; 'pages#home' match 'root' =&gt; 'pages#home' match '/home' =&gt; 'pages#home' </code></pre> <p>I've also tried:</p> <pre><code> root =&gt; 'pages#home' root :to =&gt; 'pages#home' </code></pre> <p><em>home</em> method in <strong>pages_controller.rb</strong>:</p> <pre><code> def home render 'home' end </code></pre> <p>Thank you.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload