开发者

understanding ruby on rails project [closed]

开发者 https://www.devze.com 2023-02-09 09:52 出处:网络
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

Closed 7 years ago.

Improve this question

For me to understand the rails project is not enough to see the model or controller diagrams and how many attributes and actions they're having. I understand more if I know where actions are initialized and how they ended. To describe my thoughts more specifically I'll show some example. Let's take nice open project Railscasts. I chose the Comment controller because it nested inside others controllers then it's a little harder to understand how this works. Here's my picture that helps me to understand it. 开发者_如何转开发

understanding ruby on rails project [closed]

This isn't well composed diagram but fine for me. On this picture you can see where action is started and what's the reaction on action. The action edit initiates in views/episodes/show.html.erb, comes to controller's action edit, after that shows the edit form, then go to update action and finally go back to show.html.erb. From this picture you can see that a lot of actions initiate in show.html.erb that belongs to episode controller and makes harder to understand how works the comments controller. Now you can easy find place where is action comes.

Here is my questions:

  1. Do you think this idea is useful for you, can make your developer's life easier ?

  2. Do you know some tool that can make such kind of pictures automatically ?


This is quite argumentative, but answering to question 1 :), I have to say that your diagram has a huge noise/signal ratio. Your diagram only talks me about routing which honestly in a mid-sized scenario is not so complicated to need a diagram. And does it pushing a lot of noise (why I need to see the class of a destroy link?) Rails is a lot about conventions and to be honest I don't feel the routing mechanism to be so complicated to need a diagram. Just my 2 cents.

To Question 2: I often find RubyMine model diagram to be quite useful, but I think you need a more 'dynamic' view of the project.

0

精彩评论

暂无评论...
验证码 换一张
取 消