From: Charlie Bowman Date: 2006-03-03T05:31:17+09:00 Subject: Re: cleaner Ruby in a rails view --=-c2qOSI+FyezlnPoTq3Rn Content-Type: text/plain Content-Transfer-Encoding: 7bit I guess I am being a little picky. ruby and rails both are the best at what they do and it's hard to watch it fall short ( in my very picky eyes ) in this one area. I am going to work on adding a plugin to rails that will fix the nil problem. At least then I won't have to call a helper method, rescue nil, or create an empty object just to display a view. This has been a great discussion! It's too bad that it wasn't on the rails list... > > > Something just doesn't feel right about creating an object just to > > say that it's empty. I guess I should ask this on the rails list, > > but I like this list much better :) , Is is possible to add methods > > to the nil class in only the views? If so, that would be awsome! > > I suppose you could engineer a way to do that, but it sounds awfully > fragile, and like an awful lot of trouble to go to. I'd rather > normalize the data to an array (or whatever) and then just let each > array take care of itself. > > > David Charlie Bowman http://www.recentrambles.com --=-c2qOSI+FyezlnPoTq3Rn--