Awesome
Emoji for Ruby on Rails
Installation
-
Add to your Gemfile:
gem 'rails_emoji', '~> 1.8.0'
, then:$ bundle
. -
Or, download the rails_emoji-1.8.0.gem, then
$ gem install ./rails_emoji-1.8.0.gem --no-ri --no-rdoc
.
Usage
':smile:'.emojify
# <img src="/assets/emojis/smile.png" class="emoji" width="20" height="20" alt=":smile:" title=":smile:" />
RailsEmoji.render ':smile:', size: '64x64', class: 'emoji-smile'
# <img src="/assets/emojis/smile.png" class="emoji-smile" width="64" height="64" alt=":smile:" title=":smile:" />
RailsEmoji.render ':smile:', size: nil, title: 'Smile!'
# <img src="/assets/emojis/smile.png" class="emoji" alt=":smile:" title="Smile!" />
RailsEmoji.render ':smile:', size: 32, host: 'http://MrZhang.me'
# <img src="http://MrZhang.me/assets/emojis/smile.png" class="emoji" width="32" height="32" alt=":smile:" title=":smile:" />
License
Licensed under the MIT License.