Michael Pavling wrote: > On 16 March 2010 14:35, Jeff Ramin <[email protected]> wrote: >> However, from what I've read, this new column should immediately be >> reflected in the app; in other words, when I create a new widget in the >> app, a new form field should appear on the page. But, this isn't >> happening. > > Being "reflected in the app" and appearing on the page are two different > things. > > The field *is* available as a method on the model, but it's not going > to appear on any page (other than a list that is iterating through all > the model's columns) unless you put it there. It would be highly > annoying if every time you added a field it appeared randomly on views > :-) > > You need to edit the view file (the erb, or rhtml if it's an older > version of Rails) and put the HTML to display the field you've created > wherever you want it to appear. > > if you want to be *sure*, you can add <%= @model.my_new_field %> > anywhere in the view, and edit a record in the DB - refresh to see > your DB-edited value.
Thanks. According to "Agile Web Development with Rails", the field should automagically appear on views, but that was using rails 1.2 and using scaffold in the controller. I'm running rails 2.3.x, so wasn't able to use "scaffold" in the way described in the book. Does that explain the (mis)behavior? -- 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 [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.

