Saturday, May 15, 2010

[Rails] Re: Integrate new fields in a table with CRUD functionality:

RichardOnRails wrote:
[...]
>
> But the two new fields in the expenses table (added via migration) are
> not reflected in the four app\views\expenses files. I can modify
> these four files manually with ease. But some book I perused led me
> to think that two tools would do that for me automatically:
>
> first: ruby script/generate model expense
> then: ruby script/controller expense
>
> If they'd do the job (which was my original post) of adding CRUD
> elements to my existing CRUD, then I'd like to employ them. And I
> could just employ them and learn right away that they worked or not.
> If not, I could easily recover my previous state.

Not quite. You do not need to change your model at all -- it will
figure out that the extra DB fields are there.

script/generate model and controller will not help. script/generate
scaffold might, but you're better off modifying your views manually.

[...]
> The
> question about whether I use git or my external hard drive are
> tangential to the issue I'm dealing with. Likewise, whether I use
> formal or ad hoc testing

Not really. Smart version control and smart testing are essential to
smart development: they give you the freedom to make bold changes with
confidence, and to roll back changes that don't work. Without both in
place, you're just hacking.


Best,
--
Marnen Laibow-Koser
http://www.marnen.org
marnen@marnen.org
--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate