class String
def parameterize(sep = '-')
<%= link_to(@person.name, person_path) %>
# => #
@person = Person.find(1)
end
end
"#{id}-#{name.parameterize}"
def to_param
class Person
Replaces special characters in a string so that it may be used as part of a 'pretty' URL.
def parameterize(sep = '-') ActiveSupport::Inflector.parameterize(self, sep) end