title: Replace space with dash before save using Rails 3
body: <p>I am trying to save a name to the database and a single word (firstname) works fine but when the user enter both firstname and lastname I want Rails to save it to the database as firstname-lastname instead of firstname lastname (space between).</p>
  
  <p>I know I perhaps should use a before create filter but I am not sure how this need to look like. I want the validation to work to, i.e. no two people should be able to use the same name.</p>
  
  <p>I am using Rails 3.</p>