Commit 6357f2da

mo k <mo@mokhan.ca>
2012-08-08 02:43:17
make seo frienly urls to profile page.
1 parent 59b5074
Changed files (1)
app
models
app/models/user.rb
@@ -39,4 +39,8 @@ class User < ActiveRecord::Base
   def comment_on(creation, comment)
     Comment.create_for(self, creation, comment)
   end
+  
+  def to_param
+    "#{id}-#{name.gsub(/[^a-z0-9]+/i, '-')}"
+  end
 end