On Oct 18, 12:39 am, genterminl <[email protected]>
wrote:
> I've found a difference in the files created by "./script/rails
> generate scaffold Model xxx" with rails 2.3.14 and "./script/generate
> scaffold Model xxx" with rails 3.0.10 that doesn't make sense to me.
> (both with ruby 1.8.7 on Gentoo Linux)
Is xxx what you are actually typing or just a placeholder? If it's the
former, then the difference is probably the set of inflections rails
users to pluralize xxx, which i think has changed somewhere between
2.x and 3.x. With some words, you can get situations where taking a
word, pluralizing it and then singularizing it again doesn't get you
the original word, which occasionally leads to trouble. I would expect
things to work properly with a word that was a more normal name for a
model.
Fred
>
> With 2.3.14, near the beginning of app/controllers/xxxes_controller.rb
> is the line "@xxxes = Xxx.all" and a few lines later "format.xml
> { render :xml => @xxxes }" With 3.0.10, the first is "@xxx =
> Xxx.all" and the second is has @xxx instead of @xxxes. All other
> references to xxx or xxxes are the same in both versions. This causes
> problems with 3.0.10, because app/views/xxxes/index.html.erb includes
> the line "<% @xxxes.each do |xxx| %>" which causes a nil object error.
>
> I've done plenty of searching, but haven't found anything relevant.
> Is this a bug, a feature, a side effect of misusing the scaffold
> generator, ....? Most if not all of the docs and tutorials I've found
> are not specific about which version of rails they are base on.
> Pointers to the right fine manual to read are also welcome, as I'm
> still pretty new with both ruby and rails.
>
> Thanks for any assistance.
--
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.