One Request but Double Processing

Hi,

one request from the browser results in double processing. If I debug,
the corresponding controller action will be called twice. So that
behavior isn’t a log mistake.
Any ideas?

Here is the log file output.

Processing NoticesController#edit (for 127.0.0.1 at 2009-12-12 15:14:20)
[GET]
Parameters: {“action”=>“edit”, “id”=>“2”, “controller”=>“notices”}
e[4;36;1mNotice Columns (1.0ms)e[0m e[0;1mSHOW FIELDS FROM
noticese[0m
e[4;35;1mNotice Load (0.2ms)e[0m e[0mSELECT * FROM notices WHERE
(notices.id = 2) e[0m
Rendering template within layouts/public
Rendering notices/edit
Completed in 32ms (View: 19, DB: 1) | 200 OK
[http://localhost/notices/2/edit]
e[4;36;1mSQL (0.1ms)e[0m e[0;1mSET NAMES 'utf8’e[0m
e[4;35;1mSQL (0.1ms)e[0m e[0mSET SQL_AUTO_IS_NULL=0e[0m

Processing NoticesController#edit (for 127.0.0.1 at 2009-12-12 15:14:21)
[GET]
Parameters: {“action”=>“edit”, “id”=>“2”, “controller”=>“notices”}
e[4;36;1mNotice Columns (1.0ms)e[0m e[0;1mSHOW FIELDS FROM
noticese[0m
e[4;35;1mNotice Load (0.1ms)e[0m e[0mSELECT * FROM notices WHERE
(notices.id = 2) e[0m
Rendering template within layouts/public
Rendering notices/edit
Completed in 23ms (View: 11, DB: 1) | 200 OK
[http://localhost/notices/2/edit]

Georg Kuffer wrote:

Hi,

one request from the browser results in double processing. If I debug,
the corresponding controller action will be called twice. So that
behavior isn’t a log mistake.
Any ideas?

Not until you provide the controller code.

Best,
–Â
Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Marnen Laibow-Koser wrote:

Georg Kuffer wrote:

Hi,

one request from the browser results in double processing. If I debug,
the corresponding controller action will be called twice. So that
behavior isn’t a log mistake.
Any ideas?

Not until you provide the controller code.

Best,
–Â
Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Now I attached the Application and Notice Controller.

Georg Kuffer wrote:

Hi,

one request from the browser results in double processing. If I debug,
the corresponding controller action will be called twice. So that
behavior isn’t a log mistake.
Any ideas?

Here is the log file output.

Processing NoticesController#edit (for 127.0.0.1 at 2009-12-12 15:14:20)
[GET]
Parameters: {“action”=>“edit”, “id”=>“2”, “controller”=>“notices”}
e[4;36;1mNotice Columns (1.0ms)e[0m e[0;1mSHOW FIELDS FROM
noticese[0m
e[4;35;1mNotice Load (0.2ms)e[0m e[0mSELECT * FROM notices WHERE
(notices.id = 2) e[0m
Rendering template within layouts/public
Rendering notices/edit
Completed in 32ms (View: 19, DB: 1) | 200 OK
[http://localhost/notices/2/edit]
e[4;36;1mSQL (0.1ms)e[0m e[0;1mSET NAMES 'utf8’e[0m
e[4;35;1mSQL (0.1ms)e[0m e[0mSET SQL_AUTO_IS_NULL=0e[0m

Processing NoticesController#edit (for 127.0.0.1 at 2009-12-12 15:14:21)
[GET]
Parameters: {“action”=>“edit”, “id”=>“2”, “controller”=>“notices”}
e[4;36;1mNotice Columns (1.0ms)e[0m e[0;1mSHOW FIELDS FROM
noticese[0m
e[4;35;1mNotice Load (0.1ms)e[0m e[0mSELECT * FROM notices WHERE
(notices.id = 2) e[0m
Rendering template within layouts/public
Rendering notices/edit
Completed in 23ms (View: 11, DB: 1) | 200 OK
[http://localhost/notices/2/edit]

I found the problem. It was a beginners mistake.
I work with JQuery. There were the following lines in the application.js
(I put it with the copy and paste and don’t think:))
$.ajax({
beforeSend: function(){
$(“#ajax_flash”).html(“Wird geladen…”);
},
complete: function(){
$(“#ajax_flash”).html(“”);
},
error: function(){
$(“#ajax_flash”).html(“Verbindungsfehler mit dem Server.”);
}
});
This lines causes an additional ajax request on every “normal” http
request.
Maybe I can help someone else with this fact.