Urlify Functions & Its Implementation

rubymotion
ruby

#1

URLify is a simple gem that refines the conversion of UTF-8 strings to ASCII-safe URI strings and enables it to be used as readable URL-segments. After the gem is installed, you can call the URLify function for any UTF-8 string and it will be automatically converted into an ASCII-safe URI string. URLify also has the additional functionality of being able to remove the subtitles in a given input.
ACCENTMAP

‘À’ => ‘A’,
‘Á’ => ‘A’,
‘Â’ => ‘A’,
‘Ã’ => ‘A’,
‘Ä’ => ‘A’,
‘Å’ => ‘AA’,
‘Æ’ => ‘AE’,
‘Ç’ => ‘C’,
‘È’ => ‘E’,
‘É’ => ‘E’,
‘Ê’ => ‘E’,
‘Ë’ => ‘E’,
‘Ì’ => ‘I’,
‘Í’ => ‘I’,
‘Î’ => ‘I’,
‘Ï’ => ‘I’,
‘Ð’ => ‘D’,
‘Ł’ => ‘L’,
‘Ñ’ => ‘N’,
‘Ò’ => ‘O’,
‘Ó’ => ‘O’,
‘Ô’ => ‘O’,
‘Õ’ => ‘O’,
‘Ö’ => ‘O’,
‘Ø’ => ‘OE’,
‘Ù’ => ‘U’,
‘Ú’ => ‘U’,
‘Ü’ => ‘U’,
‘Û’ => ‘U’,
‘Ý’ => ‘Y’,
‘Þ’ => ‘Th’,
‘ß’ => ‘ss’,
‘à’ => ‘a’,
‘á’ => ‘a’,
‘â’ => ‘a’,
‘ã’ => ‘a’,
‘ä’ => ‘a’,
‘å’ => ‘aa’,
‘æ’ => ‘ae’,
‘ç’ => ‘c’,
‘è’ => ‘e’,
‘é’ => ‘e’,
‘ê’ => ‘e’,
‘ë’ => ‘e’,
‘ì’ => ‘i’,
‘í’ => ‘i’,
‘î’ => ‘i’,
‘ï’ => ‘i’,
‘ð’ => ‘d’,
‘ł’ => ‘l’,
‘ñ’ => ‘n’,
‘ń’ => ‘n’,
‘ò’ => ‘o’,
‘ó’ => ‘o’,
‘ô’ => ‘o’,
‘õ’ => ‘o’,
‘ō’ => ‘o’,
‘ö’ => ‘o’,
‘ø’ => ‘oe’,
‘ś’ => ‘s’,
‘ù’ => ‘u’,
‘ú’ => ‘u’,
‘û’ => ‘u’,
‘ū’ => ‘u’,
‘ü’ => ‘u’,
‘ý’ => ‘y’,
‘þ’ => ‘th’,
‘ÿ’ => ‘y’,
‘ż’ => ‘z’,
‘Œ’ => ‘OE’,
‘œ’ => ‘oe’,
‘&’ => ‘and’
Easy Steps To Implement URLify Gem

Go to the Gemfile and add the gem urlify
Run the command bundle install

OR
In the terminal, run the command gem install urlify
A Demo Of Implementation Of URLify

Here is an example of URLify functionality:

Add gem urlify in your Gemfile
Run bundle install

We can now start using URLify API and their attributes as shown below:
Red More About it from here Urlify Functions & Its Implementation