I have a column name that has a hyphen.. not the table name but column name.. I am calling something like: @online = Status.find(:first, :conditions => {:status => ''online''} ) first problem I notes using the IRB console is to be able to get information out of the array I need to specify with element like @online[0].status this works.. but I was hoping to just use @online.status but *anyways* my problem is with hyphens.. I can''t do this: @online[0].collection-owner it just wont work I try with '''' "" and `` around it.. as well with #{} hehe just in case.. any suggestion? thanks. --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
any suggestion? thanks.> >Change the column name''s hyphen to underscore. -- Appreciated my help? Recommend me on Working With Rails http://workingwithrails.com/person/11030-ryan-bigg --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 21 May 2008, at 06:41, Ryan Bigg (Radar) wrote:> > > any suggestion? thanks. > > > Change the column name''s hyphen to underscore.Or write your own accessors to read/write it def collection_owner self[''collection-owner''] end and similarly add the writer method Fred> > > -- > Appreciated my help? > Recommend me on Working With Rails > http://workingwithrails.com/person/11030-ryan-bigg > >--~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---