簡體   English   中英

Rails:如何逐步調試請求

[英]Rails: How to step-by-step debug a request

我有一個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命令?

你看過軌道指南上的紅寶石 - 調試 ?? 你可以像在gdb中一樣進行調試

這個railscast也很有用。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM