我在许多路线上都使用了巨大的Rails代码,并且看到显示路线起始位置/索引的控制台
由HomeController#index
处理为HTML但是我什至看不到binding.pry路由被击中,但是我在终端中得到200OK响应我看到有很多过滤器被调用,但是我不知道正在调用哪个过滤器,因为有100个模块正在被调用包括。
是否有一个公式可以指导我们仅在项目中就知道操作已遍历哪个模块,而没有像在rails gem和所有内部遍历那样了解内部Rails代码。
我在chrome上为localhost:3000 /看到了一个非常白的屏幕,其中未加载任何布局。因此,我需要追溯到我的路线被击中了哪些动作,以及执行该动作涉及哪些回调以及所有回调。
[bind.pure放置在很多地方会浪费时间。
I, [2019-11-07T13:41:06.046091 #22077] INFO -- : Started GET "/" for 127.0.0.1 at 2019-11-07 13:41:06 +0530
[DEPRECATION] `strip_attributes!` is deprecated. Please use `strip_attributes` (non-bang method) instead.
[DEPRECATION] `strip_attributes!` is deprecated. Please use `strip_attributes` (non-bang method) instead.
W, [2019-11-07T13:41:07.190395 #22077] WARN -- : Creating scope :track_allowed. Overwriting existing method CustomFieldDefinition.track_allowed.
W, [2019-11-07T13:41:07.190553 #22077] WARN -- : Creating scope :document_allowed. Overwriting existing method CustomFieldDefinition.document_allowed.
W, [2019-11-07T13:41:07.190643 #22077] WARN -- : Creating scope :image_allowed. Overwriting existing method CustomFieldDefinition.image_allowed.
W, [2019-11-07T13:41:07.190724 #22077] WARN -- : Creating scope :video_allowed. Overwriting existing method CustomFieldDefinition.video_allowed.
[DEPRECATION] `strip_attributes!` is deprecated. Please use `strip_attributes` (non-bang method) instead.
[DEPRECATION] `strip_attributes!` is deprecated. Please use `strip_attributes` (non-bang method) instead.
W, [2019-11-07T13:41:07.325206 #22077] WARN -- : Creating scope :by_ids. Overwriting existing method MediaFormat.by_ids.
I, [2019-11-07T13:41:07.334538 #22077] INFO -- : Processing by MainController#home as HTML
D, [2019-11-07T13:41:07.336651 #22077] DEBUG -- : Track Load (0.6ms) SELECT "tracks".* FROM "tracks" WHERE (tracks.purged_at IS NULL)
I, [2019-11-07T13:41:07.339979 #22077] INFO -- : Completed 200 OK in 5ms (ActiveRecord: 2.3ms | Path: http://localhost:3000/)
如果您假设/
(根路径)应该达到HomeController#index
,我认为您应该检查自己的路线。