Forum: Ruby on Rails Every controller action is being process twice, help!

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
D2aae7013d89fa1fb9b47204bcfa9f69?d=identicon&s=25 ghettoiam (Guest)
on 2009-02-04 10:27
(Received via mailing list)
Regardless of what action in what controller I hit, the server is
executing the whole controller twice, sequentially.

It's goes through it once, then it goes through it again, then it
shows page.

Here is an example of output from webrick:

127.0.0.1 - - [03/Feb/2009:21:42:56 Mountain Standard Time] "GET /
contact/ HTTP/1.1" 200 22511
- -> /contact/
127.0.0.1 - - [03/Feb/2009:21:42:56 Mountain Standard Time] "GET /
contact/ HTTP/1.1" 304 0
http://localhost:3000/contact/ -> /schedules/

I go to localhost:3000/contact then it is instantly reloaded again.
The 304 means the content has not changed.

WHAT IS CAUSING THIS TO HAPPEN?!? :)

It will happen with the actions/controller below.

class PagesController < ApplicationController

  def contact
  end

  def about
  end

end

I'd appreciate sound guidance as to where I should be looking in my
code to solve this problems.  It happens on dev and in prod which are
two completely different environments.

I'll include my code from some common files where I'd think this
problem comes from, though I suspect it's something uncommon.

if I render :text => "foo" in a controller, it is not hit twice.

===== application.rb

class ApplicationController < ActionController::Base
  helper :all # include all helpers, all the time
  include AuthenticatedSystem
  include RestfulTransform

  #layout proc{ |c| c.request.xhr? ? false : "application" }

  protect_from_forgery
end

===== environment.rb

RAILS_GEM_VERSION = '2.2.2' unless defined? RAILS_GEM_VERSION

require File.join(File.dirname(__FILE__), 'boot')
ENV['INLINEDIR'] = File.join(RAILS_ROOT, 'tmp', 'ruby_inline')

Rails::Initializer.run do |config|
  config.action_controller.session = {
    :session_key => '_mma_session',
    :secret      =>
'3e0a8bbd240cc29aaa38fb04bad7452ee793ee6884d0a9ac0b0dceee06eb0bbdf6aa07ed9453ac346c160e0e624f583dbb5cdf6d7ac618c5472ce25076650d8b'
  }
   config.active_record.observers = :user_observer

end


THANK YOU VERY MUCH FOR ANY HELP!
3131fcea0a711e5ad89c8d49cc9253b4?d=identicon&s=25 Julian Leviston (Guest)
on 2009-02-04 10:51
(Received via mailing list)
Show your layout

Blog: http://random8.zenunit.com/
Learn rails: http://sensei.zenunit.com/
This topic is locked and can not be replied to.