friendly urls

This commit is contained in:
jomo
2014-09-22 06:46:08 +02:00
parent e767ec729c
commit 0f0a5c42b9
8 changed files with 37 additions and 2 deletions

View File

@@ -3,4 +3,12 @@ class Info < ActiveRecord::Base
validates_presence_of :title, :content
def to_s
title
end
def to_param
[id, to_s.parameterize].join("-")
end
end