On 16 March 2010 14:55, Jeff Ramin <[email protected]> wrote:
> 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?

Which version of the book have you got?! If it's v2 or earlier, lots
of it is going to be wrong for the version you have installed, which
is going to be very frustrating at times.


But yes - the scaffolding used to loop through all the columns :

<% for column in License.content_columns %>
<p>
  <b><%= column.human_name %>:</b> <%=h @license.send(column.name) %>
</p>
<% end %>

...but that's intensely annoying because you have to *totally* remove
it to replace it with anything useful.

Now, the individual fields get rendered one after an other - so you
can tweak the scaffolded file, rather than re-write it completely.

(of course the down side is if you add a new field to the db, you have
to add it to the view)

-- 
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