Rails:如何逐步调试请求



我有一个ajax请求,导致我的Rails 3.0.9应用程序出现问题。我可以在日志中看到这个问题,但我不知道是什么在ajax调用和渲染之间触发了它。这是日志,以及我不希望旁边有**的事件:

Started DELETE "/notifications/13" for 127.0.0.1 at 2011-06-21 22:08:39 -0500
  Processing by NotificationsController#destroy as JS
  Parameters: {"id"=>"13"}
  SQL (0.4ms)   SELECT name
 FROM sqlite_master
 WHERE type = 'table' AND NOT name = 'sqlite_sequence'
  SQL (0.3ms)   SELECT name
 FROM sqlite_master
 WHERE type = 'table' AND NOT name = 'sqlite_sequence'
  User Load (0.8ms)  SELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1
  Slug Load (0.4ms)  SELECT "slugs".* FROM "slugs" WHERE ("slugs".sluggable_id = 1 AND "slugs".sluggable_type = 'User') ORDER BY id DESC LIMIT 1
  ****AREL (0.3ms)  UPDATE "users" SET "remember_token" = NULL, "remember_created_at" = NULL, "updated_at" = '2011-06-22 03:08:40.084049', "preferences" = '---
:email_notifications: ''true''
' WHERE "users"."id" = 1
  Notification Load (0.2ms)  SELECT "notifications".* FROM "notifications" WHERE "notifications"."id" = 13 LIMIT 1
  User Load (0.9ms)  SELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1
  AREL (0.3ms)  UPDATE "users" SET "notifications_count" = COALESCE("notifications_count", 0) - 1 WHERE "users"."id" = 1
  AREL (0.1ms)  DELETE FROM "notifications" WHERE "notifications"."id" = 13
Completed 200 OK in 1334ms

我想以某种方式一步一步地调试这个请求,有点像使用firebug在javascript中逐步调试函数的方式。

有没有一种方法可以像这样调试,这样我就可以看到特定的AREL命令是如何被调用的??

您看过ruby on rails指南-调试吗??您可以像在gdb 中一样进行调试

这个轨道支架也很有用。

最新更新