How to add an Emoji in Ruby on Rails Application

add an Emoji in Rails Application

Want to add emojis in your rails application? But don’t know how? Don’t worry too much about that, we have a gem for this. ‘gemoji’ gem is available which can be used when you have to add emojis in your application. Quite interesting, right?

Let’s see how to add and show emojis in Rails Application.

What is Gemoji?

How to use it?

Here’s a step-by-step guide to include emojis in your app!

gem 'gemoji'

bundle exec gemoji extract public/images/emoji

<%= emojify(Hurreyy party time, let’s have some:pizza:!) %>

Now the above sentence is used as content in the helper method. This method extracts emoji characters and displays related emoji in our sentence.

Further Reading: Adding Page Specific JS to Rails Application

Using that, our sentence looks like the one below:

Hurrayy party time, let’s have some Pizza !

How to add new emoji?


This will create new emoji and you can use emoji.raw to display it.

While creating emoji, it uses unicode_alias. But what if you don’t know unicode_alias or you want to create custom emoji then you can also do it.

Now, you have to download a particular image and add it to your images/emoji directory to access it.

For more information, see this Emoji cheat sheet and to find unicode_alias, follow this.

That’s it !! Now you are ready to use emojis. You can find the complete code here.

Click here for more details

Consulting is free – let us help you grow!

Related posts

React Native: Why Migrate from Flutter, Ionic & others

by Rajan Tank
6 years ago

How to Configure Razorpay Webhook in Ruby on Rails

by Leena Chaudhari
5 years ago

Ecommerce Applications During the Time of Covid19

by Shardul Bhatt
6 years ago
Exit mobile version