On Jun 9, 1:16 am, Ali Akhtarzada <ali.akhtarz...@gmail.com> wrote: > Oh ok. Did not know that. Thanks! > > After I got rid of the '@' part they were still returning nil. I had an > attr_accessor :first_name, :last_name defined. Things worked after getting > rid of that. I guess having attr_Accessor with the same names overrides the > method calls or something?
You don't need attr_accessor for attributes from the database - attr_accessor will overwrite (or prevent the generation of) the accessors active record provides. Fred > > Thanks again! > > > > On Wed, Jun 9, 2010 at 1:26 AM, Michael Pavling <pavl...@gmail.com> wrote: > > On 8 June 2010 13:56, Marnen Laibow-Koser <li...@ruby-forum.com> wrote: > > > pepe wrote: > > >> On Jun 8, 3:10 am, Michael Pavling <pavl...@gmail.com> wrote: > > >>> def full_name > > >>> [first_name, last_name].join(" ") > > >>> end > > > >>> ...now, if you're missing a first or last name, you don't get extra > > >>> white-space padding > > > > Actually, I believe you do, unless you compact the array first (posting > > > from iPhone away from irb right now, so can't verify). > > > 100% correct... sorry - my real methods do compact before the join... > > just not when I write them in Gmail! :-) > > > -- > > 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-t...@googlegroups.com. > > To unsubscribe from this group, send email to > > rubyonrails-talk+unsubscr...@googlegroups.com<rubyonrails-talk%2Bunsubscrib > > e...@googlegroups.com> > > . > > For more options, visit this group at > >http://groups.google.com/group/rubyonrails-talk?hl=en. -- 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-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.