Module | Sluggable
In: | app/models/sluggable.rb

### Methods

to_param

### Public Instance methods

to_param()

[Source]

        # File app/models/sluggable.rb, line 2
     2:   def to_param
     3:     # Quitar todo lo que no sea letra o numero
     4:     words = title.tildes.strip.downcase.gsub(/[^a-z0-9]+/, ' ').split
     5:     # Sin palabras de 1 o 2 letras
     6:     long_words = words.collect {|w| w if w.length>2}.compact
     7:     short_name = long_words.join('-')
     8:     # short_name = short_name[0..60].sub(/-[^-]+$/, '') unless short_name.length <= 60 # Quitamos desde el final hasta el - anterior para no cortar palabras
     9:     # Quitar guiones al principio o a final
    10:     short_name = short_name.gsub(/-+$/, '').gsub(/^-+/, '')
    11:     "#{id}-#{short_name}"
    12:   end

[Validate]