Hi Colin,

Thanks for joining the conversation. I appreciate it.

> You must have a look at the code for the views ...

I have looked at the views in my app and understand them well.  That
enabled by use existing and create new tools in Ruby that allow me to
make fine-combed searches in my app's code and make whole sale changes
semi-automatically.

So to make the changes I needed to the database,  I used Rail's tool
for that purpose: migration.

As I just said, I used my tools to bring the app to compatibility with
the DB changes.

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.

But perhaps there's a smarter way to do this job, or a nuance I should
be learn about.  Hence my post to guys like you and Marnen.  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.

Does this long response make any sense to you guys?  Should I just
forget my wish to Rails' tools and make my humble changes manually?

Again, thanks for taking the time to consider my questions,
Richard



On May 15, 4:17 pm, Colin Law <[email protected]> wrote:
> On 15 May 2010 19:53, RichardOnRails
>
>
>
> <[email protected]> wrote:
> > Thanks for your response.
>
> > Yes.  The model consists only of the empty class definition.
>
> > But it's got views for show, new, etc.  However, none of these views
> > are updated to reflect my new and renamed fields.
>
> > On May 15, 1:53 pm, Marnen Laibow-Koser <[email protected]> wrote:
> >> RichardOnRails wrote:
> >> > Hi,
>
> >> > I've got an "expenses" table which I modified as follows:
> >> > added column "account_number"
> >> > renamed column "type" to "transaction_type"
>
> >> > Can I add  CRUD for the columns with:
> >> > first: ruby script/generate model expense
> >> > then: ruby script/controller  expense
>
> >> Does this table not already have an associated Rails model?
>
> > Yes.  The model consists only of the empty class definition.
>
> > But it's got views for show, new, etc.  However, none of these views
> > are updated to reflect my new and renamed fields.
>
> You must have a look at the code for the views, understand the code
> (which is not a bad idea) and modify it to achieve what you want.  But
> first modify your tests, check they fail (as the new data is not yet
> displayed) then modify the views and check the tests pass.
>
> But even before that make sure that you have committed your code to
> your version control system (git probably).
>
> Colin
>
> --
> 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 [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group 
> athttp://groups.google.com/group/rubyonrails-talk?hl=en.

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to