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
- Esegui il comando installazione del pacchetto
A Demo Of Implementation Of URLify
Here is an example of URLify functionality:- Add gem urlify in your Gemfile
- Esegui l'installazione del bundle
Riferimenti:
Git Hub : https://github.com/beastaugh/urlify Ruby on Rails Gems : https://dzone.com/articles/10-ruby-on-rails-gems-for-web-development RailsCarma offers end-to-end ruby on rails development solutions that caters to everything from deployment to support and hosting. We put together great ideas & professional coding skills to deliver stable, efficient & successful mobile and web applications for your business. Mettiti in contatto con noi oggi for best-in-industry solutions for your business! Salva Salva SalvaIscriviti per gli ultimi aggiornamenti
Articoli correlati