I'm trying to stuff like this in my BabyName model..

  before_save :capitalize

  def capitalize
    self.title        = title.capitalize
    self.forename     = forename.capitalize
    self.surname      = surname.capitalize
    self.middlenames  = middlenames.split.each { |x| print
x.capitalize!, " "}.join(" ")
  end

  def full_name
    self.title + " " + self.forename + " " + self.middlenames + " " +
self.surname
  end

  def initials

  end


  #

two things;

1) my full_name method doens't seem great in that I might get two spaces
between names.
2) how do I grab the initials method ?
-- 
Posted via http://www.ruby-forum.com/.

-- 
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.

Reply via email to