English 中文(简体)
一位老练的编程者,混淆了如何从rat头开始穿 co的铁路。
原标题:A seasoned programmer, confused on how to start coding a rails app from scratch

我过去曾参与过一些铁路项目,但我参加了这些项目,并配备了完全建成的铁路,经过光谱测试、工厂、模型、观点、控制器和一些海关图书馆。 我有数百人承诺在这些项目中设置分配票,我很了解铁路机动车辆的建筑。

但是,现在,我需要自行制造一条铁路,尽管我有铁路经验,但我没有信心开始。

我的最大问题是,如何决定我将要设立的控制人员,我所创建的控制者的目的是什么,整个网络设计,现在我头上发生了这么多的事情,而且我只是想一想。

是否有任何人像我一样面临同样的问题?

最佳回答

When starting a new application, I usually sketch out (on paper) a really high-level overview of what I think the core models of the app are going to be, and how they relate to one another. Obviously these will likely change as your application evolves during the development process, but it s a good place to start.

然后,从该集合中,我确定应用目标最核心的模式——我首先生成<代码>铁路模型模型Name<>。 例如:我最近正在编写一本旅馆名录,开始采用<条码>Hotel模式。

Then I apply some pretty basic TDD methodologies and start writing the spec for the unit test for that model, run the tests, build, write more spec, refactor, etc. As bits fall into place, do a commit and move on. That way, if you go down a wrong path, it s easy to get back to a healthy spot again and you don t have to worry (as much) about making mistakes.

I usually find that by starting with the unit tests for the core models, the rest of your application will naturally evolve out. Once you decide to move onto functional and integration tests you should have a really clear idea about how all the pieces fit together and how your users should flow through your application. This should naturally lead you to develop controllers that fit your different user s scenarios.

最重要的是,实践是从零开始的最佳途径。 形成一些具有真正明确结果的基本数据,如博客或简单的时间安排工具。 当你转向更大规模或更抽象的用途时,它将帮助你利用这一进程——你更善于脱离实地。

问题回答

我首先要讲一句话,你把一个小的系统放在一旁。

http://guides.rubyonrails.org/getting_started.html

如果你已经设立了所有机构,你可以ski到3.2。

此外,如果你不喜欢它所走的方向,则确保你经常使用版本控制软件和分机/转机(我建议像甘特这样的分布式控制系统,因为它们往往有更好的分机/合并)





相关问题
rails collection_select vs. select

collection_select and select Rails helpers: Which one should I use? I can t see a difference in both ways. Both helpers take a collection and generates options tags inside a select tag. Is there a ...

SSL slowness in EC2

We ve deployed our rails app to EC2. In our setup, we have two proxies on small instances behind round-robin DNS. These run nginx load balancers for a dynamically growing and shrinking farm of web ...

Auth-code with A-Za-z0-9 to use in an URL parameter

As part of a web application I need an auth-code to pass as a URL parameter. I am currently using (in Rails) : Digest::SHA1.hexdigest((object_id + rand(255)).to_s) Which provides long strings like : ...

RubyCAS-Client question: Rails

I ve installed RubyCAS-Client version 2.1.0 as a plugin within a rails app. It s working, but I d like to remove the ?ticket= in the url. Is this possible?

activerecord has_many :through find with one sql call

I have a these 3 models: class User < ActiveRecord::Base has_many :permissions, :dependent => :destroy has_many :roles, :through => :permissions end class Permission < ActiveRecord::...

Ordering a hash to xml: Rails

I m building an xml document from a hash. The xml attributes need to be in order. How can this be accomplished? hash.to_xml

Text Editor for Ruby-on-Rails

guys which text editor is good for Rubyonrails? i m using Windows and i was using E-Texteditor but its not free n its expired now can anyone plese tell me any free texteditor? n which one is best an ...

How to get SQL queries for each user where env is production

I’m developing an application dedicated to generate statistical reports, I would like that user after saving their stat report they save sql queries too. To do that I wrote the following module: ...

热门标签