hi i am using this command to scaffold G:\my\webblog>ruby script/generate scaffold Comments comments:text but i got the folllwoing error, can any one help to rectify htis problam........ -- Posted via http://www.ruby-forum.com/.
2009/7/5 Rajendra Bayana <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>:> > hi i am using this command to scaffold > > G:\my\webblog>ruby script/generate scaffold Comments comments:text > > but i got the folllwoing error, can any one help to rectify htis > problam........ > -- > Posted via http://www.ruby-forum.com/.You don''t seem to have included the error. It would be more conventional to have ruby script/generate scaffold comment description:string Note that comment is singular and without upper case (not Comments) which will make a model class Comment for a table comments containing a text field description. I don''t know whether having a field with the same name as the model would cause a problem, but in any case in the code if you then have a Comment object @comment then referring to @comment.comments is a bit odd. @comments.description or another field name that you like seems more natural. Colin
2009/7/5 Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>:> 2009/7/5 Rajendra Bayana <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>: >> >> hi i am using this command to scaffold >> >> G:\my\webblog>ruby script/generate scaffold Comments comments:text >> >> but i got the folllwoing error, can any one help to rectify htis >> problam........ >> -- >> Posted via http://www.ruby-forum.com/. > > You don''t seem to have included the error. > It would be more conventional to have > ruby script/generate scaffold comment description:string > > Note that comment is singular and without upper case (not Comments) > which will make a model class Comment for a table comments containing > a text field description. I don''t know whether having a field with > the same name as the model would cause a problem, but in any case in > the code if you then have a Comment object @comment then referring to > @comment.comments is a bit odd. @comments.description or another field > name that you like seems more natural. > > Colin >Sorry I am getting it wrong myself now, it should be ruby script/generate scaffold Comment description:text Colin