简体   繁体   English

我如何了解Actionpack并使用Rails对其进行调试

[英]How do i understand actionpack and debug it with Rails

When i reading the source code,I was just not concept or not way to debuging. 当我阅读源代码时,我只是没有概念或没有办法进行调试。 To be exact ,I wouldn't know where to begin. 确切地说,我不知道从哪里开始。

My understanding is: 我的理解是:

First I need to read is the routing. 首先,我需要阅读的是路由。 But i don't know where is initialization Routes when starting the service. 但是我不知道启动服务时初始化路由在哪里。 I tried to start with Rake understanding. 我试图从对Rake的理解开始。 But I don't know how to correlate them. 但是我不知道如何将它们关联起来。 It is important, I don't know how they interact . 重要的是,我不知道它们如何相互作用 I only know superficial concept, ... What should I do next? 我只知道肤浅的概念,...接下来我该怎么办?

Thank you for your time. 感谢您的时间。

The routes are usually defined in config/routes.rb and you can test that they're working correctly by running rake routes to see how they're interpreted. 路由通常在config/routes.rb定义,您可以通过运行rake routes来查看其解释方式,以测试它们是否正常工作。

If you keep your routing table simple, which is best done by following a strict REST-ful approach, then you'll have entries like: 如果使路由表保持简单(最好通过遵循严格的REST-ful方法来完成),则将具有以下条目:

resources :users

If you diverge from the REST-ful approach, which is sometimes necessary, be aware that it will complicate your routing file, so be cautious before doing this. 如果您有时需要使用与REST不同的方法,请注意,它将使您的路由文件复杂化,因此在执行此操作之前请务必谨慎。

rake is a general utility used by Rails and other Ruby applications to perform utility functions. rake是Rails和其他Ruby应用程序用来执行实用程序功能的通用实用程序。 In the Rails world it's primarily used for executing rake test and rake routes as most of the other functions are handled by the rails command itself. 在Rails世界中,它主要用于执行rake testrake routes因为其他大多数功能都是由rails命令本身处理的。

I would start with reading some Rails Guides ( http://guides.rubyonrails.org/ ) 我将从阅读一些Rails指南( http://guides.rubyonrails.org/ )开始

Debugging Rails Applications would be a good start http://guides.rubyonrails.org/debugging_rails_applications.html 调试Rails应用程序将是一个不错的开始http://guides.rubyonrails.org/debugging_rails_applications.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM